Test your knowledge
We use the
static
keyword followed by a method declaration to define:An instance method.
A class method.
A class constant.
We use the
final
static keywords followed by an initialized variable declaration to define a:Class constant.
Class variable.
Instance constant.
A class constant:
Has its own and independent value for each instance of the class.
Has the same value for all the instances of the class.
Has the same value for all the instances of a class, unless it is accessed through the class name followed by a dot (
.
) and the constant name.
An instance field:
Has its own and independent value for each instance of the class.
Has the same value for all the instances of the class.
Has the same value for all the instances of a class, unless it is accessed through the class name followed by a dot (
.
) and the instance field name.
In Java 9,
public
,protected
, andprivate
are:Three different classes defined in
java.lang
.Three equivalent access modifiers.
Three different access modifiers...