Blank final field in Java

Blank final field in Java

A variable that is declared as final and not initialized is called a blank final variable. A blank final variable forces the constructors to initialize it.

In other words
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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.