you can think of the Java compiler as having the make functionality already built in.
Final Fields/Object Variable
final field 要求这个变量一定要在 construct 结束之前确定 field value
A class is immutable if none of its methods ever mutate its objects. (For example, the String class is immutable.)
Final and Mutable Object
private final StringBuilder evaluations = new StringBuilder();public void giveGoldStar() { evaluations.append(LocalDate.now() + ": Gold star!\n"); }
The final keyword merely means that the object reference stored in the evaluations variable will never again refer to a different StringBuilder object. But the object can be mutated.