Programming - Inner Classes
You Are Here :: Home > JAVA > Inner Classes - Jdbc
13.
________________ Inner classes have no name, and their type must be either a subclass of the named type or an implementr of the named interface.
A.
Anonymous
B.
named
C.
unnamed
D.
Both B and C
Answer: Option A
Explanation:
Anonymous Inner classes have no name, and their type must be either a subclass of the named type or an implementr of the named interface.
14.
An ______________________________ inner class can extend one subclass or implement one interface.
A.
anonymous
B.
named
C.
unnamed
D.
Both B and C
Answer: Option A
Explanation:
An anonymous inner class can extend one subclass or implement one interface.Anonymous Inner classes have no name, and their type must be either a subclass of the named type or an implementr of the named interface.
15.
An argument-defined inner class is declared, defined, and automatically instantiated as part of a______________________________.
A.
method invocation.
B.
Method Overriding
C.
method overloading
D.
polymorphism
Answer: Option A
Explanation:
An argument-defined inner class is declared, defined, and automatically instantiated as part of a method invocation.
16.
Static nested classes are inner classes marked with the _________________ modifier.
A.
static
B.
final
C.
private
D.
public
Answer: Option A
Explanation:
Static nested classes are inner classes marked with the static modifier.
17.
A static nested class cannot access ____________________ members of the outer class.
A.
non-static
B.
static
C.
both A and B
D.
final
Answer: Option A
Explanation:
Since it doesnot have an implicit reference to any outer instance.
18.
____________________ classes nest within other classes.
A.
Inner
B.
outer
C.
both
D.
static
Answer: Option A
Explanation:
Inner classes nest within other classes.
« prev
next »