Java - Language Fundamentals Questions and Answers
Practice ModeShowing 10 of 39 questions
Q31
Which feature makes Java platform independent?
Answer: Option C
Explanation: Java bytecode runs on any JVM, making it platform independent.
Q32
What will be the output of System.out.println(10 + 20 + "Java");?
Answer: Option C
Explanation: Integer addition occurs before string concatenation.
Q33
Which of the following is a valid array declaration?
Answer: Option D
Explanation: Both array declaration styles are valid in Java.
Q34
Which keyword refers to the current object in Java?
Answer: Option A
Explanation: this refers to the current object instance.
Q35
Which literal represents a long data type?
Answer: Option B
Explanation: L suffix indicates a long literal.
Q36
Which keyword prevents a method from being overridden?
Answer: Option C
Explanation: final methods cannot be overridden.
Q37
Which class is commonly used to take input from the keyboard?
Answer: Option B
Explanation: Scanner is widely used for user input.
Q38
Which of the following is NOT a valid Java keyword?
Answer: Option D
Explanation: Java does not support the unsigned keyword.
Q39
Which of the following best describes Java?
Answer: Option C
Explanation: Java follows object-oriented programming principles.