Sunday, June 15, 2014

Java studying for interview - Top level and inner class crib notes


Reference Card

 
Top level nested class
Non static inner class
Local class
Anonymous class
Declaration ContextAs static class memberAs non-static class memberIn block with non-static contextIn block with non-static context
Accessibility ModifiersAllAllNoneNone
Outer instanceNoYesYesYes
Direct Access to enclosing contextStatic members in enclosing contextAll members in enclosing contextAll members in enclosing context + local final variablesAll members in enclosing context + local final variables
Defines static or non-static membersBoth static and non-staticOnly non-staticOnly non-staticOnly non-static
ConstructorsYesYesYesNo
Can use extends or implements clauses?YesYesYesNo

No comments:

Post a Comment