• 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

reserved keywords

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
pbulic, static, void,main,String,args...which 3 are reserved keywords?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

Tell us your guess, and we'll tell you if you're right.
 
shirsa ray chaudhuri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is it ...main,arg and static...
 
Ranch Hand
Posts: 341
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are partially correct. static is correct. Well done.

Ok one hint: As a layman reserved keywords are those which are used by the language itself.

Now in the words you mentioned which all are used by Java language to specify something e.g. some access level or other.
[ April 08, 2008: Message edited by: Anubhav Anand ]
 
shirsa ray chaudhuri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
then which are other 2?
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
public - access specifier
static - modifier
void - tells that method won't return any value

These are the three reserved words.
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Anubhav Anand:
...reserved keywords are those which are used by the language itself.



and can not be used as the names for the user defined elements like variables, class, etc.,

Moreover they have some "special" meaning to the environment in which your application is running!
[ April 09, 2008: Message edited by: Raghavan Muthu ]
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, just for your reference, here
is the complete list of Java reserved words.

Hope this helps
[ April 09, 2008: Message edited by: Amit Ghorpade ]
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Amit Ghorpade:
Hi, just for your reference, here
is the complete list of Java reserved words.



Not quite. It's the list of Java keywords. All keywords are reserved words, but not all reserved words are keywords.

For instance, false, true and null are reserved words, but are not keywords.

Note that the term "reserved keyword", used by the original poster, is not a proper Java term. The proper Java terms are "keyword" and "reserved word".

Beginners may think that distinctions like this are just picky, but computer programming is not like ordinary communication. When you talk to a reasonably-bright human, they will work out what you mean, even if your language is a bit inexact. When you program a computer, if you don't get it exactly right, the computer will do nothing, or (worse) the wrong thing.
[ April 09, 2008: Message edited by: Peter Chase ]
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow.. that's a great catch Peter!

and Yes, you are absolutely right!
reply
    Bookmark Topic Watch Topic
  • New Topic