File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reserved keywords

 
shirsa ray chaudhuri
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pbulic, static, void,main,String,args...which 3 are reserved keywords?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it ...main,arg and static...
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then which are other 2?
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Amit Ghorpade
Bartender
Posts: 2851
10
Fedora Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Peter Chase
Ranch Hand
Posts: 1970
  • 0
  • Mark post as helpful
  • send pies
  • 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: 3381
Mac MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow.. that's a great catch Peter!

and Yes, you are absolutely right!
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic