Final

From Abap2Java

Jump to: navigation, search

Abap

Java

If a class is declared as final, no other class can inherit from it.

If a method is declared as final, derivatived classes can not overwrite it.

If a field is declared as final, the value of it can not be changed and must be initialized immediately.

public static final int MAGIC_NUMBER = 0;
// not so common
public final int BETTER_STATIC = 1;

If a local variable is declared as final, its value can not be changed.

See also
class, method, field, static

Personal tools