Access Modifiers
(4)
Optional Specifiers
strictfp Not on the OCA or OCP exam. Used for making oating-point calcu- lations portable.
Varargs in Methods
(2)
A vararg parameter must be the last element in a method’s parameter list. This implies you are only allowed to have one vararg parameter per method.
public static void walk(int start, int… nums) { System.out.println(nums.length);
}
–> walk(3) will output 0
(Java creates an array of lenghth 0 for int… nums)
Applying Access Modifiers
(4)
Reasons for static Methods
(2)
Static vs. Instance
(2)
* Koala k = new Koala(); System.out.println(k.count); // outputs count k = null; System.out.println(k.count); //still outputs count * A static member cannot call an instance member.
Static Imports
import static package.class.methodName;
import static package.class.variableName;
Overloading Methods
(2)
Order for Overloaded Methods
(4)
Order of Initialization
Encapsulation
(5)
Immutable Classes
(3)
Lambda Syntax
Accessing Variables in Lamdas
Predicates
public interface Predicate<t> {<br></br> boolean test(T t);<br></br>} </t>