Java Programming - Language Fundamentals - Discussion
Discussion Forum : Language Fundamentals - General Questions (Q.No. 2)
2.
Which one of these lists contains only Java programming language keywords?
Answer: Option
Explanation:
All the words in option B are among the 49 Java keywords. Although goto reserved as a keyword in Java, goto is not used and has no function.
Option A is wrong because the keyword for the primitive int starts with a lowercase i.
Option C is wrong because "virtual" is a keyword in C++, but not Java.
Option D is wrong because "constant" is not a keyword. Constants in Java are marked static and final.
Option E is wrong because "include" is a keyword in C, but not in Java.
Discussion:
64 comments Page 2 of 7.
Mukesh said:
9 years ago
c++ use goto as well. So how could option (b) is correct?
(1)
Indrajeet Singh said:
9 years ago
You may see keywords list of java after seeing that you will get the correct answer.
Java Language Keywords
Here is a list of keywords in the Java programming language. You cannot use any of the following as identifiers in your programs. The keywords const and goto are reserved, even though they are not currently used. true, false, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.
abstract continue for new switch
assert*** default goto* package synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum**** instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp** volatile
const* float native super while
Java Language Keywords
Here is a list of keywords in the Java programming language. You cannot use any of the following as identifiers in your programs. The keywords const and goto are reserved, even though they are not currently used. true, false, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.
abstract continue for new switch
assert*** default goto* package synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum**** instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp** volatile
const* float native super while
(1)
Avinash hake said:
9 years ago
goto is not used in Java.
Manish mrityunjay said:
9 years ago
The answer should be A because goto is a key word but not use in java.
Jayesh said:
9 years ago
If instances of, native are keywords then when we use in our Java programs.
Vishnu said:
9 years ago
When we use "volatile" and "transient" in Java?
Prashant said:
9 years ago
But goto is also used in C. So this is the wrong option.
Sudeshna Sarkar said:
9 years ago
Is it necessary to know all the names of the 49 java keywords?
Krishna patel said:
9 years ago
The, What about volatile?
Suman said:
10 years ago
Why goto keyword is not used?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers