Inner Class Java PPT Krisha
Inner Class Java PPT Krisha
BY : K R I S H A A M B A L I YA ( 1 2 3 0 2 0 8 0 5 0 1 0 2 7 )
K R I S H N A R AT H O D ( 1 2 3 0 2 0 8 0 5 0 1 0 2 8 )
WHAT IS INNER CLASS?
• A member inner
class is defined
inside a class
but outside any
method.
• It can access all
members
(including private)
of the outer class.
• It is associated
with an instance
of the outer class.
STATIC NESTED CLASS
• A class that
doesn’t have a
name and is used
to provide an
implementation
of an interface
or extend a
class on the spot.
• Often used in
event handling
or thread
creation.
LOCAL INNER CLASS
• Defined inside a
method or a block.
• Can access final or
effectively final
variables from the
enclosing method.
• Its scope is limited
to the block/method
in which it's defined.
ADVANTAGES