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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

abstract

A
  • incomplete, missing definition

- an abstract class can’t be instantiated, only extended

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

static vs instance members

A

a static member is shared class-wide while an instance member is associated with a single instance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly