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:
63 comments Page 4 of 7.

Avinash hake said:   9 years ago
goto is not used in Java.

Akshay Nikule said:   2 months ago
- Keywords are the words which already know to the compiler.
- In Java there are 49 keywords.
- Keywords also known as 'Reserve words'
- There are 51 'Reserve words' in Java.
- Every keyword is reserve word, but not every reserve word is not keyword
- 'Const' and 'goto' is Reserve word but not keywords.

Swarna said:   1 decade ago
Siva: finally is a keyword, used along with try block. It is an optional block. The purpose is to close any opened connections within the program for security.

Sundar said:   1 decade ago
@Tarun

You are wrong. Java has the keyword 'goto' (but not used).

Refer: http://en.wikipedia.org/wiki/List_of_Java_keywords

Disha said:   1 decade ago
But could you please tell me why "goto" keyword is not in use in java.

Srinivas said:   1 decade ago
When we use strictfp and assert in java?

Saranya said:   1 decade ago
Do we have goto in java.

Bharat said:   1 decade ago
What is use of "Instanceof"&"Native".

Nag said:   1 decade ago
Can anybody explain strictfp and assert and Instanceof " & "Native".

Ravindra said:   1 decade ago
What is the actual use of virtual? Can you tell me something.


Post your comments here:

Your comments will be displayed after verification.