Rob
SCJP 1.4
Cud somebody clarify my understanding on java keywords by answering these questions. I seem to be lost inbetween the terms "keyword" and "reserved word" .
1 Which of the following are java keywords ?
a> short
b> goto
c> null
d> true
2. Which are java reserved words ?
a> short
b> goto
c> null
d> true
Thanks in advance!
Originally posted by Ruchi Kolla:
For Q1: a,b,c,d
For Q2:b
Originally posted by Jennifer Wallace:
Interestingly, the discussion has confused me more!
1. Which are java keywords ?
Ans: a and b
2. Which are java reserved words ?
Ans: a,b,c,d
Originally posted by Jennifer Wallace:
1. Which are java keywords ?
a> short
b> goto
c> null
d> true
Ans: a and b
Reason: Simply because 'null' and 'true' dont appear in the list of keywords.
2. Which are java reserved words ?
a> short
b> goto
c> null
d> true
Ans: a,b,c,d
Reason : All keywords, and boolean literals 'true' and 'false' and null literal are reserved in Java.
Please correct me if I am way off mark !
Thanks !
Rob
SCJP 1.4
Originally posted by Junilu Lacar:
Ruchi,
You can check your answers against this authoritative source: http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#229308
![]()
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|