This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes const keyword in  Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "const keyword in  Java" Watch "const keyword in  Java" New topic
Author

const keyword in Java

Kaarthick Ramamoorthy
Greenhorn

Joined: Sep 01, 2006
Posts: 23
Hi to all,

Why const keyword has been reserved in Java?. What is the purpose of reserving it?.
Praveen Babu
Ranch Hand

Joined: Jul 30, 2006
Posts: 138
From JLS,

The keywords const and goto are reserved, even though they are not currently used. This may allow a Java compiler to produce better error messages if these C++ keywords incorrectly appear in programs.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: const keyword in Java
 
Similar Threads
final and const
Questions on naming convention
Constants in Java
Final
Constant and Final