Answer Posted / harish
Inner classes nest within other classes. A normal class is
a direct member of a package, a top-level class. Inner
classes, which became available with Java 1.1, come in four
flavors:
? Static member classes
? Member classes
? Local classes
? Anonymous classes
Let's take a quick look at each in turn.
Briefly, a static member class is a static member of a
class. Like any other static method, a static member class
has access to all static methods of the parent, or top-
level, class.
Like a static member class, a member class is also defined
as a member of a class. Unlike the static variety, the
member class is instance specific and has access to any and
all methods and members, even the parent's this reference.
Local classes are declared within a block of code and are
visible only within that block, just as any other method
variable.
Finally, an anonymous class is a local class that has no
name.
Is This Answer Correct ? | 6 Yes | 6 No |
Post New Answer View All Answers
Can interface be private in java?
What is a method signature java?
Can we override private constructor in java?
What is a method type?
What is tochararray in java?
What is the collection interface?
Which is dependent variable?
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
What is the purpose of java?
Why array is used in java?
Why does my function print none?
What is the size of a string in java?
What is the difference between inner class and nested class?
What is the purpose of static methods and static variables?
What is the difference between dom and sax parser in java?