Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • I think you lost me there, since it's NOT a final variable isn't it possible that it could change vlaue? Commented Sep 12, 2014 at 0:33
  • @Mechanic45, Okay, I've changed it. I set b as final now. This should address your concern. Commented Sep 12, 2014 at 0:41
  • Oh! and this way if I add more "common variables" I can just add them in one constructor and just adjust the args.So it is safe to not declare them final AND not worry :P. Thanks a lot it helped tremendus-iously! :) Commented Sep 12, 2014 at 0:42
  • @Mechanic45, I declare b as final now so that you won't be allowed to set it again. Commented Sep 12, 2014 at 0:50
  • 1
    @Mechanic45 Say you have a Class D and you already know that you want to set it to false. What you can do is this: D() { super(false) } You don't have to asked them to provide the value of b in your constructor anymore. Commented Sep 12, 2014 at 1:06