Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

MATH and null bug me.....

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does MATH class have a final Constructor ?
Well some books say null is a keyword and some say it's not. What is anyway ? I think it is a reserved word as you cannot use it for any member variable.
The same for true and false....
------------------
regards,
NEO
Keep on trying guys, the goal is not too far....
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Neo,
Constructors of Math class are defined final, so that it cannot be instantiated.
Also you cannot subclass Math class.
null, true and false - IMHO, as far as SCJP is considered, just remember that they cannot be used for identifier names. Do not bother whether they are reserved or keyword words.
regards
sankar
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sankar S:
[B]Hi Neo,
Constructors of Math class are defined final, so that it cannot be instantiated.
That is not true. The constructor is defined private so
you can't instantiate it. Constructors are not allowed to be
final.
Also you cannot subclass Math class.
That is true and the effect of final
Regards
Jakob

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jakob Bosshard.
I am making this mistake for the third time( twice in mock exams). somehow getting confused between private and final for constructors.
Maybe after this i will never forget this concept.
cheers
sankar
 
neo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys....
------------------
regards,
NEO
Keep on trying guys, the goal is not too far....
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic