Java Programming - Language Fundamentals - Discussion
Discussion Forum : Language Fundamentals - General Questions (Q.No. 5)
5.
Which is a valid keyword in java?
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 3 of 3.
San said:
7 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.
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.
Harsh thakkar said:
6 years ago
Float is also valid because it is wrapper class.
Harsh thakkar said:
6 years ago
Float is also valid because it is wrapper class.
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.
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.
Jaya surya said:
2 years ago
String is an java data type and immutable in nature.
Abhishek Raj said:
1 year ago
"Float" is a valid keyword in Java.
(1)
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers