WHAT IS BLANK FINAL VARIABLE IN JAVA?

Royce Roy

Total Post:51

Points:255
Posted by  Royce Roy
Java 
 736  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    What is blank final variable in java?

    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.

    class Student{  
    int id;  
    String name;  
    final String PAN_CARD_NUMBER;  
    ...  
    }  

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!