1. Which two of the following are legal declarations for nonnested classes and interfaces? final abstract class Test {} public static interface Test {} final public class Test {} protected abstract class Test {} protected interface Test {} abstract public class Test {}





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 02 Jun 2017 01.25 am
    (3), (6). Both are legal class declarations. (1) is wrong because a class cannot be abstract and final—there would be no way to use such a class. (2) is wrong because interfaces and classes cannot be marked as static. (4) and (5) are wrong because classes and interfaces cannot be marked as protected.
Show Similar Question And Answers
QA->There are two divisions A and B of a class, consisting of 36 and 44 students respectively. If the average weight of divisions A is 40 kg and that of division b is 35 kg. What is the average weight of the whole class?....
QA->There are 50 students in a class. In a class test 22 students get 25 marks each, 18 students get 30 marks each. Each of the remaining gets 16 marks. The average mark of the whole class is :....
QA->Average height of 10 students in a class is 150 cm. A boy of height 160 cm left the class and a boy of height 148 cm is admitted. Then what is the average height of the students in the class now?....
QA->.....is a device by virtue of which two persons at two different places can communicate. It consists of two main parts (i) a microphone and (ii) a receiver.?....
QA->Two statements are given followed by two conclusions I and II. You have to consider the two statements to be true even if they seem to be at variance from commonly known facts. You have to decide which one of the given conclusions is definitely drawn from the given statements. Statement : All virtuous persons are happy. No unhappy person is virtuous. Conclusions : I. Happiness is related to virtue II. Unhappy person is not virtuous.....
MCQ->Which two of the following are legal declarations for nonnested classes and interfaces? final abstract class Test {} public static interface Test {} final public class Test {} protected abstract class Test {} protected interface Test {} abstract public class Test {}....
MCQ->interface Base { boolean m1 (); byte m2(short s); } which two code fragments will compile? interface Base2 implements Base {} abstract class Class2 extends Base { public boolean m1(){ return true; }} abstract class Class2 implements Base {} abstract class Class2 implements Base { public boolean m1(){ return (7 > 4); }} abstract class Class2 implements Base { protected boolean m1(){ return (5 > 7) }}....
MCQ->Which of the following statements are correct about an interface in C#.NET? A class can implement multiple interfaces. Structures cannot inherit a class but can implement an interface. In C#.NET, : is used to signify that a class member implements a specific interface. An interface can implement multiple classes. The static attribute can be used with a method that implements an interface declaration.....
MCQ->Which of the following is/are legal method declarations? protected abstract void m1(); static final void m1(){} synchronized public final void m1() {} private native void m1();....
MCQ->Which of the following statements are correct about an interface used in C#.NET? An interface can contain properties, methods and events. The keyword must implement forces implementation of an interface. Interfaces can be overloaded. Interfaces can be implemented by a class or a struct. Enhanced implementations of an interface can be developed without breaking existing code.....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution