In this case, the method has a void return
type which indicates
that the method does not return anything. However, the return
keyword is still specified.
080.
a.
b.
c.
d.
081.
CHAPTER
07
Inner Classes
What is an inner class? What are the different types of
inner classes?
Answer:
An inner class is any class defined inside the body of another
class. There are 4 types of inner classes as follows:
Nested class: Class is defined
within the body of another
class. It has access to all the members of the outer class.
Static nested class: A nested class
that is static is known as
a static nested class. It cannot access non–static members of
the outer class.
Method local inner class: A class that is defined inside a
method of another class is known
as a method local inner
class. Such an inner class can only access final members of
the outer class.
Do'stlaringiz bilan baham: