Java Programming - Language Fundamentals
Why should I learn to solve Java Programming questions and answers section on "Language Fundamentals"?
Learn and practise solving Java Programming questions and answers section on "Language Fundamentals" to enhance your skills so that you can clear interviews, competitive examinations, and various entrance tests (CAT, GATE, GRE, MAT, bank exams, railway exams, etc.) with full confidence.
Where can I get the Java Programming questions and answers section on "Language Fundamentals"?
IndiaBIX provides you with numerous Java Programming questions and answers based on "Language Fundamentals" along with fully solved examples and detailed explanations that will be easy to understand.
Where can I get the Java Programming section on "Language Fundamentals" MCQ-type interview questions and answers (objective type, multiple choice)?
Here you can find multiple-choice Java Programming questions and answers based on "Language Fundamentals" for your placement interviews and competitive exams. Objective-type and true-or-false-type questions are given too.
How do I download the Java Programming questions and answers section on "Language Fundamentals" in PDF format?
You can download the Java Programming quiz questions and answers section on "Language Fundamentals" as PDF files or eBooks.
How do I solve Java Programming quiz problems based on "Language Fundamentals"?
You can easily solve Java Programming quiz problems based on "Language Fundamentals" by practising the given exercises, including shortcuts and tricks.
- Language Fundamentals - General Questions
- Language Fundamentals - Finding the output
- int -> 0
- String -> "null"
- Dog -> null
- char -> '\u0000'
- float -> 0.0f
- boolean -> true
(1), (3), (4), (5) are the correct statements.
(2) is wrong because the default value for a String (and any other object reference) is null, with no quotes.
(6) is wrong because the default value for boolean elements is false.
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.
The only legal array declaration and assignment statement is Option D
Option A is wrong because it initializes an int array with String literals.
Option B is wrong because it use something other than curly braces for the initialization.
Option C is wrong because it provides initial values for only one dimension, although the declared array is a two-dimensional array.
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'.
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.