modifier

  • Modifier: Use like an adjective.

Adding extra(additional) meaning in front of class and class members(class members or methods)

  • access modifier : public, protected, (default), private // one of them.

  • else : static, final, abstract, native, transient, synchronized, volatiole, strictfp//possible to have multiple

  1. static

modifier

subject

meaning

static : (class of, common)

member variable

  • common class variable for all instances(=object)

  • available without creating instance

  • being created when class is loaded on memory

method

  • available to call static method without creating instance

  • CANNOT use instance members(iv, im) within satic method because instance members might not exist

2. final

modifier

subject

meaning

final : non-changable, non-expandable

class

CANNOT be parent

method

non-changable method.=>CANNOT be overriding.

member variable

non-changable, just being constant.

local variable

non-changable, just being constant.

3. abstract

=> CANNOT create instance(object) because it is not completed.

=> Can create instance via inheritance completing implementation of abstract method(class).

modifier

subject

meaning

abstract : literally abstract, not completed

class

There is abstract method in class

method

There is only declaration and no implementation contents.

Last updated