Java Programming - Language Fundamentals - Discussion

Discussion :: Language Fundamentals - General Questions (Q.No.2)


Which one of these lists contains only Java programming language keywords?

[A]. class, if, void, long, Int, continue
[B]. goto, instanceof, native, finally, default, throws
[C]. try, virtual, throw, final, volatile, transient
[D]. strictfp, constant, super, implements, do
[E]. byte, break, assert, switch, include

Answer: Option B


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.

Tarun said: (Sep 30, 2010)  
Java does not have 'goto' key word.

Sundar said: (Oct 1, 2010)  

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


Disha said: (Oct 1, 2010)  
But could you please tell me why "goto" keyword is not in use in java.

Srinivas said: (Nov 24, 2010)  
When we use strictfp and assert in java?

Saranya said: (Dec 23, 2010)  
Do we have goto in java.

Bharat said: (Jan 4, 2011)  
What is use of "Instanceof"&"Native".

Nag said: (Mar 12, 2011)  
Can anybody explain strictfp and assert and Instanceof " & "Native".

Ravindra said: (Mar 22, 2011)  
What is the actual use of virtual? Can you tell me something.

Archana said: (Mar 26, 2011)  
Is if is a keyword.

Swarna said: (Apr 24, 2011)  
What is the use of native key word?

Srinivas said: (Apr 28, 2011)  
What is the meaning of "final" in java, when we need 'final', is 'final' is a key word in java.

Siva said: (May 19, 2011)  
Is "finally" a keyword? where it is used?

Naresh.K said: (Jun 3, 2011)  
The final is a keyword. This is similar to const keyword in other languages. This keyword may not be used as identifiers i.e. you cannot declare.

Native is a Java keyword that is used in method declarations to specify.... This keyword signals to the Java compiler that the function is a native language.

Rashmi Upadhyay said: (Jul 2, 2011)  
Please tell me the meaning of native language?

Vishwanath said: (Aug 12, 2011)  

A Java keyword used to restrict the precision and rounding of floating point calculations to ensure portability.

Praveen Reddy said: (Sep 22, 2011)  
Nag and swarna: native is a valid keyword used in java. It is used to declare the modify methods.

Swarna said: (Sep 30, 2011)  
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.

Ridhi said: (Oct 12, 2011)  
Please tell me the use of native keyword.

Sarvesh said: (Dec 14, 2011)  
Instanceof is a operator not a keyword. ?

Pradip said: (Mar 3, 2012)  
Can you tell me? why we are not use goto keyword if it is there in java language?

Kotiyal said: (Mar 12, 2012)  
The 'final' is a keyword in Java. After using this keyword on class we can't extend that class and on variable we can't change the value of that variable.

Vaibhav Kotiyal said: (Mar 28, 2012)  
Native Keyword indicate That the method is written in Platform dependent language Such As C.

We can Say that if we want to use method that is written in another Language and we wanna to use then native keyword overcome this problem.

Sreedhar said: (Sep 2, 2012)  
What is the use of goto keyword in java?

If there is no use then why they included this as keyword.

Kunal said: (Sep 4, 2012)  
The goto keyword is not available to the programmer that means the programmer can't use the goto keyword.

Mukesh Meena said: (Sep 27, 2012)  
Goto performs a one-way transfer of control to another line of code. Goto is not used and has no function.

Padmashri said: (Oct 4, 2012)  
When we use strictfp and assert in java?

Anu said: (Jan 19, 2013)  
strictfp is a keyword in the Java programming language that restricts floating-point calculations to ensure portability. It was introduced into Java with the Java virtual machine (JVM) version 1.2.

Sanku said: (Jan 23, 2013)  
Final is the keyword that which cannot be used as identifier.

Native is the word which the compiler is dependent on OS.

Frillo said: (Jun 14, 2013)  
Java has a "reserved word" called goto, but it's not a keyword since it is not used.

Lishit said: (Aug 4, 2013)  
Instanceof is an operator which operates on an object and determines whether it belongs to the same class. So its not a keyword. While keyword are reserved words which can be used for achieving certain situation which doesn't give any result so instanceof is an operator.

Pallavi said: (Aug 5, 2013)  
Is default is a keyword?

Mdn said: (Sep 13, 2013)  
The default can optionally be used in a switch statement to label a block of statements to be executed if no case matches the specified value.

Puri Kiki said: (Sep 19, 2013)  
"goto" have got what purpose in java?

Arul said: (Oct 6, 2013)  
What is the use of instance & native keyword? can you give example?

Rahul said: (Jan 22, 2014)  
What's the whole idea behind this ?

Thiru said: (Jul 11, 2014)  
Goto is not used in java because,

In older language(BASIC,COBOL) are "program driven languages where program logic drives the users, so they decide the flow, hence need "GoTo".

But todays, languages, are "Event driven languages", where application's objects (menu, buttons, form elements ...) are listening user's response and go by it.

Vishesh said: (Sep 23, 2014)  
None of the option is correct. Given answer B having goto is keyword of both Java and C.

Satya said: (Feb 5, 2015)  
Can you give explanation about "program driven languages" and "event driven languages"?

Sum said: (Mar 7, 2015)  
Include is not a keyword in C. It is not in the list of words of 32 keywords of C.

Veerapaga Srinivasulu said: (Mar 12, 2015)  
Yes goto is Java keyword but not use.

Kirankumar said: (Jun 16, 2015)  
Sir goto is a keyword of C not keyword of Java right (or) wrong?

Deep Vakharia said: (Aug 26, 2015)  
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.

Premchand said: (Aug 27, 2015)  
Java has goto keyword but not in use.

Deepak Kumar J said: (Oct 1, 2015)  
When goto keyword used in Java.

Suman said: (Jan 27, 2016)  
Why goto keyword is not used?

Krishna Patel said: (Jul 11, 2016)  
The, What about volatile?

Sudeshna Sarkar said: (Jul 31, 2016)  
Is it necessary to know all the names of the 49 java keywords?

Prashant said: (Aug 23, 2016)  
But goto is also used in C. So this is the wrong option.

Vishnu said: (Sep 1, 2016)  
When we use "volatile" and "transient" in Java?

Jayesh said: (Sep 28, 2016)  
If instances of, native are keywords then when we use in our Java programs.

Manish Mrityunjay said: (Nov 8, 2016)  
The answer should be A because goto is a key word but not use in java.

Avinash Hake said: (Jan 8, 2017)  
goto is not used in Java.

Indrajeet Singh said: (Feb 1, 2017)  
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

Mukesh said: (Mar 16, 2017)  
c++ use goto as well. So how could option (b) is correct?

Alok Raj Singh said: (Jun 29, 2017)  
But goto is also use in C Language.

Naseem said: (Sep 27, 2017)  
Wrong, "goto" is not a java keyword.

Vipul said: (Feb 2, 2018)  
Goto is a keyword in java and c/c++. So how it is java only keyword?

Sagar Shinde said: (Jun 25, 2019)  
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.

Rakesh said: (Nov 23, 2019)  
In java there is no "goto" statement. Then how is the option B is correct.

Pavithra said: (Apr 13, 2021)  
In Java, we use the goto keyword when we write "labelled break " to break for loops.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.