Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8192167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:06:53+00:00 2026-06-07T04:06:53+00:00

I was looking at another question about final variables and noticed that you can

  • 0

I was looking at another question about final variables and noticed that you can declare final variables without initializing them (a blank final variable). Is there a reason it is desirable to do this, and when is it advantageous?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:06:55+00:00Added an answer on June 7, 2026 at 4:06 am

    This is useful to create immutable objects:

    public class Bla {
        private final Color color;
    
        public Bla(Color c) {this.color = c};
    
    }
    

    Bla is immutable (once created, it can’t change because color is final).
    But you can still create various Blas by constructing them with various colors.

    See also this question for example.

    EDIT

    Maybe worth adding that a “blank final” has a very specific meaning in Java, which seems to have created some confusion in the comments – cf the Java Language Specification 4.12.4:

    A blank final is a final variable whose declaration lacks an initializer.

    You then must assign that blank final variable in a constructor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking at learning some C since i saw in another SO question that is
This is related to another Delphi-version question but still different; I'm looking for a
I was looking to implement a python script that called another script and captured
I've asked about this very example in another question: Fill in a form with
Another collinear-points question. This one's twist is, I'm using integer arithmetic, and I'm looking
Another random question that hit me (I've drank ~9 cups of coffee in the
Got a question about using mod_rewrite to redirect specific subdomains to use another domain.
I asked this question about a year ago on another site but never got
I have a simple question about url or domain redirect. I was looking through
I have already posted another question about this, but no one seemed to know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.