Blank or uninitialized final variable

A final variable that is not initialized at the time of declaration is known as blank final variable. If you want to create a variable that is initialized at the time of creating object and once initialized may not be changed, it is useful. For example PAN CARD number of an employee. It can be initialized only in constructor.


\begin{lstlisting}
class Student{
int id;
String name;
final String PAN_CARD_NUMBER;
...
}
\end{lstlisting}

We can initialize blank final variable, but only in constructor. For example:


\begin{lstlisting}
class Bike10{
final int speedlimit;//blank final variable
...
...public static void main(String args[]){
new Bike10();
}
}
\end{lstlisting}

The output for the above code snippet will be 70.