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?
class, if, void, long, Int, continue
goto, instanceof, native, finally, default, throws
try, virtual, throw, final, volatile, transient
strictfp, constant, super, implements, do
byte, break, assert, switch, include
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:
62 comments Page 1 of 7.

Jeevanantham said:   4 months ago
Goto keyword is used in C language also, then how do say that it is only in Java language?

Anyone please explain to me.
(1)

Saurabh said:   3 years ago
Though goto is not a frequently used keyword, still a keyword,

And here, the question is which has only one keyword (whether used or not used is not mentioned).
(1)

Sagar shinde said:   5 years ago
I think (A) is correct answer because the all keyword in answer (A) is used in java, as your answer (B) the GOTO keyword is not used in java. Because the flow of execution of program in java use bottom-up approach and it does not support the GOTO keyword.
(1)

Suman said:   8 years ago
Why goto keyword is not used?

Puri kiki said:   1 decade ago
"goto" have got what purpose in java?

Deepak kumar J said:   9 years ago
When goto keyword used in Java.

Premchand said:   9 years ago
Java has goto keyword but not in use.

Deep Vakharia said:   9 years ago
Goto is not used in java and as an alternative java has provided us inner and out loop function we can break the loop that we want to. So there's no use of goto in Java.

Kirankumar said:   9 years ago
Sir goto is a keyword of C not keyword of Java right (or) wrong?

Veerapaga srinivasulu said:   9 years ago
Yes goto is Java keyword but not use.


Post your comments here:

Your comments will be displayed after verification.