What is blank final variable

0 votes
I know about final variable. But, I came across blank final variable as well. Can you help me understand that ?
Nov 29, 2018 in Java by Neha
• 6,300 points
1,787 views

1 answer to this question.

0 votes

A final variable in Java can be assigned a value only once, we can assign a value either in a declaration or later.

    final int i = 10;
    i = 30; // Error because i is final.

blank final variable in Java is a final variable that is not initialized during declaration. Below is a simple example of blank final.

    // A simple blank final example 
    final int i;
    i = 30;

How are values assigned to blank final members of objects?
Values must be assigned in constructor.

answered Nov 29, 2018 by Frankie
• 9,830 points

Related Questions In Java

0 votes
1 answer

What is casting variable in java?

Casting is, taking an Object of one ...READ MORE

answered Jul 17, 2018 in Java by scarlett
• 1,290 points
756 views
+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

answered Jul 25, 2018 in Java by samarth295
• 2,220 points
3,578 views
0 votes
2 answers

What is the syntax to initialize an array?

Rather than learning un-Official websites learn from ...READ MORE

answered Aug 2, 2018 in Java by samarth295
• 2,220 points
993 views
0 votes
2 answers

What is the difference between implements and extends?

Extends : This is used to get attributes ...READ MORE

answered Aug 3, 2018 in Java by samarth295
• 2,220 points
16,218 views
0 votes
2 answers

What is the use of final class in java?

In Java, items with the final modifier cannot be ...READ MORE

answered Oct 5, 2018 in Java by Daisy
• 8,140 points
1,890 views
0 votes
1 answer

Interface variable are static and final by default. Why?

Interface variables are static because Java interfaces ...READ MORE

answered Jul 4, 2018 in Java by Daisy
• 8,140 points
13,461 views
0 votes
1 answer

Why Java String class is declared as final?

String class is made final in Java ...READ MORE

answered Aug 22, 2018 in Java by code.reaper12
• 3,500 points
6,729 views
0 votes
1 answer
+1 vote
4 answers

What is a simple way to repeat a string in java?

There is already answer wriiten using StringBuilder ...READ MORE

answered Dec 16, 2020 in Java by Rajiv
• 8,870 points
29,255 views
0 votes
1 answer

What is Enum in Java?

 It means that the type argument for ...READ MORE

answered Nov 13, 2018 in Java by Frankie
• 9,830 points
853 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP