Java Programming - Part-2
AInheritance
BPolymorphism
CEncapsulation
DNone
Correct Answer
Polymorphism
AClass
BObject
CSuperclass
DNull
Correct Answer
Object
AMultiple Inheritance
BMulti-Level Inheritance
CSingle Inheritance
DHierarchical Inheritance
Correct Answer
Multiple Inheritance
AAll the classes and interfaces of this package and subpackages
BAll the classes and interfaces of this package
COnly classes of this package
DNone
Correct Answer
All the classes and interfaces of this package
Apublic
Bdefault
Cprivate
Dprotected
Correct Answer
default
Apublic
Bdefault
Cprivate
Dprotected
Correct Answer
protected
Apublic
Bdefault
Cprivate
Dprotected
Correct Answer
private
AnextLine()
BreadLine()
CnextInt()
DNone of the above
Correct Answer
readLine()
AConsole c = new Console();
BConsole c = new Console(System.in);
CConsole c = System.console();
DNone of above
Correct Answer
Console c = System.console();
Ainitialize the object
Bprovide default values to an object
Cprovide different values to distinct objects
DAll the above
Correct Answer
All the above
AConstructor name must be same as it's Class name
BConstructor must have explict return type
CConstructor must have no explict return type
DNone of the above
Correct Answer
Constructor must have explict return type
AEncapsulation
BAbstraction
CData Hiding
DPolymorphism
Correct Answer
Encapsulation
AEncapsulation
BInterface
CComposition
DInheritance
Correct Answer
Inheritance
Correct Answer
None
Aaccess the variables in parent class
Baccess the variables in child class
Caccess the methods in parent class
Daccess the variables and methods in parent class
Correct Answer
access the variables and methods in parent class
AThe final keyword can be appiled on classes to prevent inheritance
BThe final keyword can be appiled on methods to disallow method overridding
CThe final keyword can be appiled on methods to disallow method overloading
DThe final keyword can be appiled on variables to declare constants
Correct Answer
The final keyword can be appiled on methods to disallow method overloading
Amethod overloading
Bmethod overriding
Cboth method overloading and overriding
Dnone of the above
Correct Answer
method overloading
Amethod overloading
Bmethod overriding
Cconstructor overloading
Dnone of the above
Correct Answer
method overloading
Amethod overloading
Bmethod overriding
Cconstructor overloading
Dnone of the above
Correct Answer
method overriding
AMethods must have same name
BMethods must have same method parameters
CIS-A relationship between child and parent class
DClass name and method name must be same.
Correct Answer
Class name and method name must be same.
AClass-C inherits from Class-A and Class-B inherits from Class-C
BClass-C inherits from Class-A and Class-B
CClass-B inherits from Class-A and Class-B inherits from Class-A
DNone of the above
Correct Answer
Class-C inherits from Class-A and Class-B inherits from Class-C
Astatic
Bprivate
Cfinal
Dnone of the above
Correct Answer
final
Asuper, sub
Bsub, super
Csuper, super
Dsub, sub
Correct Answer
super, sub
ADynamic
BStatic
CBoth
DNone of the above
Correct Answer
Dynamic
AOnly abstract methods.
BOnly non abstract methods.
CAbstract and non abstract methods.
DNone of the above
Correct Answer
Abstract and non abstract methods.