Mindmap
Week 2: Classes, interfaces and variable length parameters
Inhalt der Mindmap
Week 2: Classes, interfaces and variable length parameters
Access modifiers
- private
- accessible wihin class only
- proteced
- accessible in package and sub-classes
- sub-class might not be same package
- same package should not access but may
- accessible in package and sub-classes
- public
- accessible anywhere
- inteface public by default
- private
Other modifiers (non-access)
- static
- may access field/method via class
- does not require object instance
- fields/methods shared by all instance of class
- static inner class may be intantiated without outer class
- final
- may not be changed once initiaised
- class cannot subclasses thus extended
- field initialise once and cannot be changed
- method can't be overidden
- may not be changed once initiaised
- static
Types of classes
- Named/'normal'
- instantiated
- multiple instances
- has fields
- all methods implemented
- can be extended/implemented
- Abstract
- cannot instantiate
- used as base class for inheritance (used for polymorphism)
- multiple instances
- methods abstract or implemented
- can be extended or implemented
- large group, related data
- Inner
- may access outer class field & methods
- cannot exist alone (unless static)
- instantiated within outer class
- multiple instances
- all methods implemented
- can be extended or implemented
- only makes sense or is valid in the outer class
- not reusable in another context
- static inner
- same as named class
- use when wanting a nested relationship but still accessible outside
- Anonymous
- defined inline
- no name
- class declared and instantiated at same time
- cannot have multiple instances
- cannot be extended or implemented
- use: small object to implement. extension not important
- defined inline
- Named/'normal'
Informationen
- Beschreibung
- Computer Science Mindmap am Week 2: Classes, interfaces and variable length parameters, erstellt von Creshe Naidoo am 02/07/2018.
- Erstellt von
- Creshe Naidoo
- Aufrufe
- 0
- Bewertung