Java Programming - Language Fundamentals - Discussion

Discussion Forum : Language Fundamentals - General Questions (Q.No. 5)
5.
Which is a valid keyword in java?
interface
string
Float
unsigned
Answer: Option
Explanation:

interface is a valid keyword.

Option B is wrong because although "String" is a class type in Java, "string" is not a keyword.

Option C is wrong because "Float" is a class type. The keyword for the Java primitive is float.

Option D is wrong because "unsigned" is a keyword in C/C++ but not in Java.

Discussion:
26 comments Page 1 of 3.

Abhishek Raj said:   4 months ago
"Float" is a valid keyword in Java.

Jaya surya said:   1 year ago
String is an java data type and immutable in nature.

Ramzan Ali said:   4 years ago
@Kote.

Final keyword is used for variable, method, and class for restrictions purposes.

1. When we declare any variable as final then we can not change the value of that variable.
2. If we declare any method as a final then we can not override that method.
3. If we declare a class as a final then we can not inherit that class.

Harsh thakkar said:   5 years ago
Float is also valid because it is wrapper class.

Harsh thakkar said:   5 years ago
Float is also valid because it is wrapper class.

San said:   6 years ago
@Kote.

The final keyword can be used for both classes & methods.
A final class cannot be extended.
A final method cannot be overridden.
Math class, StringBuilder, StringBuffer are examples for final classes.
Constants are final.

Palaniarjun said:   7 years ago
String is not a key word, String is one of the predefined class in java.

Brandon ceasar said:   7 years ago
@Vijaya.

About 49 keywords.
(1)

Kote said:   8 years ago
Can you explain about final keyword.

Vijaya said:   8 years ago
How many keywords are there in Java programming language?


Post your comments here:

Your comments will be displayed after verification.