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 3 of 3.

Harry said:   1 decade ago
@Lemky.

float is keyword not Float.

Lemky said:   1 decade ago
Float comes under the keywords list in Java. In this question why only interface is the answer ?

Milanvachhani.blogspot.com said:   1 decade ago
Interface is one type of class that do not have method implementation. It contains prototype of methods and variables. Variable of interface are final and static by default. You have to implement interface.

Gaurav said:   1 decade ago
Anyone please tell the functionality of the keyword interface i am new to java....

Raja said:   1 decade ago
interface interface name
{
....
}

Sundar said:   1 decade ago
public class Car
{
...
}

Car c = new Car();


Explanation:

'Car' is a class type.

'c' is an object of type 'Car'.


Post your comments here:

Your comments will be displayed after verification.