Home / Programming Questions / JAVA MCQs / Page 9

JAVA MCQs with answers Page - 9

Dear candidates you will find MCQ questions of JAVA here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question

R

Ram Sharma • 178.09K Points
Coach

Q. What is the error in this code? byte b = 50; b = b * 50;

(A) b can not store the result 2500, limited by its range
(B) * operator has converted b * 50 into int, which can not be converted to byte without casting.
(C) b can not contain value 50.
(D) No error in this code

R

Ram Sharma • 178.09K Points
Coach

Q. Which of these is an incorrect array declaration?

(A) int arr[] = new int[5];
(B) int [] arr = new int[5];
(C) int arr[]; arr = new int[5];
(D) int arr[] = int [5] new

R

Ram Sharma • 178.09K Points
Coach

Q. Which of these selection statements test only for equality?

(A) if
(B) switch
(C) Both a & b
(D) None of the mentioned

R

Ram Sharma • 178.09K Points
Coach

Q. Which of these are selection statements in Java?

(A) if
(B) for
(C) continue
(D) all of these

R

Ram Sharma • 178.09K Points
Coach

Q. Which of these jump statements can skip processing remainder of code in its body for a particular iteration?

(A) break
(B) return
(C) exit
(D) continue

R

Ram Sharma • 178.09K Points
Coach

Q. What is the value of the expression 2 & 3 ?

(A) 2
(B) 3
(C) 5
(D) 6

R

Ram Sharma • 178.09K Points
Coach

Q. What is the value of the expression 8 << 2 ?

(A) 2
(B) 32
(C) 1 6
(D) 5

R

Ram Sharma • 178.09K Points
Coach

Q. The keyword used to create a constant variable

(A) const
(B) static
(C) final
(D) none of these

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.