File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes reserved keywords Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "reserved keywords" Watch "reserved keywords" New topic
Author

reserved keywords

shirsa ray chaudhuri
Greenhorn

Joined: Apr 08, 2008
Posts: 10
pbulic, static, void,main,String,args...which 3 are reserved keywords?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Hi,

Welcome to JavaRanch!

Tell us your guess, and we'll tell you if you're right.


[Jess in Action][AskingGoodQuestions]
shirsa ray chaudhuri
Greenhorn

Joined: Apr 08, 2008
Posts: 10
is it ...main,arg and static...
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

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

Joined: Apr 08, 2008
Posts: 10
then which are other 2?
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

public - access specifier
static - modifier
void - tells that method won't return any value

These are the three reserved words.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

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 ]

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

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 ]

SCJP, SCWCD.
|Asking Good Questions|
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
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 ]

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Wow.. that's a great catch Peter!

and Yes, you are absolutely right!
 
GeeCON Prague 2014
 
subject: reserved keywords