I was looking at another question about final variables and noticed that you can declare final variables without initializing them (a blank final variable). Is there a reaso
The final property of class must have a value assigned before object is created. So the last point where you can assign value to them is constructor.
This is used often for immutable objects.
public class Foo {
private final Bar bar;
public Foo(Bar bar) {
this.bar = bar;
}
public Bar getBar() {
return new Bar(bar);
}
}
What wiki says about it
Defensive copying.