Top

Language Fundamentals - General Questions

Answer: C

A boolean can only be assigned the literal true or false.

Enter details here

12.

Which is a reserved word in the Java programming language?

Answer: B

The word "native" is a valid keyword, used to modify a method declaration.

Option A, D and E are not keywords. Option C is wrong because the keyword for subclassing in Java is extends, not 'subclasses'.

Enter details here

Answer: 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.

Enter details here

Answer: A

Option A sets the String reference to null.

Option B is wrong because null cannot be in single quotes.

Option C is wrong because there are multiple characters between the single quotes ('abc').

Option D is wrong because you can't cast a char (primitive) to a String (object).

Enter details here

Loading…
Tags: Language Fundamentals - General Questions Questions and Answers || Language Fundamentals - General Questions MCQ Questions and Answers || Language Fundamentals - General Questions GK Questions and Answers || Language Fundamentals - General Questions GK MCQ Questions || Language Fundamentals - General Questions Multiple Choice Questions and Answers || Language Fundamentals - General Questions GK || GK on Language Fundamentals - General Questions || Java Programming Questions and Answers || Java Programming MCQ Questions and Answers || Java Programming GK Questions and Answers || GK on Java Programming