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,140 points
34 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,590 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,280 points
25 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,190 points
103 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,190 points
28 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,190 points
355 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,020 points
30 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,020 points
272 views
0 votes
1 answer

Why Java String class is declared as final?

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

answered Aug 21, 2018 in Java by code.reaper12
• 3,450 points
38 views
0 votes
1 answer
+1 vote
1 answer

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

From Java 11 on, there's a method String::repeat that does ...READ MORE

answered Aug 28, 2018 in Java by Frankie
• 9,590 points
106 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,590 points
25 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.