#11 inner classes Flashcards
(10 cards)
type erasure
how java implements generics:
type T is replace by object type. Then when you want to return T, Java cast the object to the type you want
advantage of generics
uses are checked at compile time rather than runtime
inner class
class defined inside scope of other class
inner class can access
all fields and methods in its outer class
outer class can access
all fields and methods in its inner class
inner classes can be viewed out side the outer class??
heck yea if it does not have privacy modifiers that keep it private
relationship between inner and outer classes
inner class objects must be instantiated with an outer class object. (linked at birth)
is an inner class a subclass?
nope
to use an inner class outside its outer class
OuterClass.InnerClass (inner class obj. is associated with the OuterClass in the dot notation)
use inne rclass inside outer class
use inner class normally