• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Infomation about "final" modifer

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I came to know that if we use the final keyword to a member variable, then it has to be initialized either at declaration or through Constructor or static initializer.
Ref: the following code (Mock Exam from go4java Q25)

I have the following questions:
1. Can some one give better explanation for the above code?
2. Is there any other points to know about the final keyword?
Thanks in advance
Bala.
[This message has been edited by Bala Rajamani (edited October 08, 2001).]
 
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your code you are not initializing the final variable during declaration.. Such variables are called "Blank Final" variables.

Originally posted by Bala Rajamani:
[B]Hi,
I came to know that if we use the final keyword to a member variable, then it has to be initialized either at declaration or through Constructor or static initializer.
Ref: the following code (Mock Exam from go4java Q25)

I have the following questions:
1. Can some one give better explanation for the above code?
2. Is there any other points to know about the final keyword?
Thanks in advance
Bala.
[This message has been edited by Bala Rajamani (edited October 08, 2001).][/B]


reply
    Bookmark Topic Watch Topic
  • New Topic