Search This Blog

27 June, 2011

Inner classes and multiple inheritance in Java


• Interfaces provide one route to multiple
inheritance.


• Inner classes provide another route.


• This second route is not documented, and sun
documentation speaks of adapter classes.


• However, while inner classes may be used in that
context, adapter classes are irrelevant to the
basic syntax of inner classes.


• One class may be defined within another.


• Such a class is called a nested class.


• A static nested class behaves like a top-level
class (i.e., a class which is not contained in any
class)


• A non-static nested class is called an inner class.


• Such nested classes may be defined within any
expression.


-------------------------------------
Nested and inner classes (contd)
-------------------------------------

No comments:

Post a Comment

Meetme@