Programming - Inner Classes
You Are Here :: Home > JAVA > Inner Classes - Jdbc
1.
An _____________________ instance shares with an instance of the outer class
A.
inner class
B.
outer class
C.
static class
D.
final variable
Answer: Option A
Explanation:
This Special relationship gives code in the inner class access to members of the enclosing outer class,as if the inner class were part of the outer class.
2.
Is inner class instance has access to all members of the outer class,even those marked as private?
A.
Yes
B.
No
C.
cant say
D.
Maybe
Answer: Option A
Explanation:
Yes inner class instance has access to all members of the outer class,even those marked as private.
3.
We use the term regular here to represent inner classes that are not a)static b)method-local c)Anonymous
A.
both a and b
B.
both b and c
C.
both a and c
D.
all the above
Answer: Option D
Explanation:
We use the term regular here to represent inner classes that are not a)static b)method-local c)Anonymous
4.
To create an instance of an _______________________,you must have an instance of the outer class to tie to the inner class.
A.
inner class
B.
outer class
C.
both A and B
D.
none of these
Answer: Option A
Explanation:
To create an instance of an inner class,you must have an instance of the outer class to tie to the inner class.
5.
It is the outer class that createss instances of the ___________________________.
A.
inner class
B.
outer class
C.
both A and B
D.
none of these
Answer: Option A
Explanation:
Since,it is usually the outer class wanting to use the inner instance as a helpe for its own personal use.
6.
The code to make an instance from anywhere outside _________________ code of the outer class is simple.
A.
static
B.
non static
C.
both A and B
D.
none of these
Answer: Option B
Explanation:
The code to make an instance from anywhere outside non static code of the outer class is simple.
next »