Keywords Flashcards
1
Q
static
A
- defines class members
- shared across all instances
- Static members are globally available to all instances of a class. So if it is changed in. a part, it changes for all of them.
- A word of caution: a static method can only use other static members within the same class.
2
Q
final
A
- declares something immutable (cannot be changed)
- primitive vars can’t modify values
- reference vars can’t switch references
- methods can’t be overridden
- classes can’t be extended
3
Q
abstract
A
- incomplete, missing definition
- an abstract class can’t be instantiated, only extended
4
Q
child class
A
- if a child class extends an abstract class, it must override all inherited abstract methods to provide an implementation of its own
- If you do not do this, the subclass must also be declared abstract – it’s not complete yet
5
Q
static vs instance members
A
a static member is shared class-wide while an instance member is associated with a single instance.