Home / Programming Questions / JAVA MCQs / Page 267

JAVA MCQs with answers Page - 267

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

M

Mr. Dubey • 51.47K Points
Coach

Q. DataInput is ________________.

(A) an interface that defines methods to read primitive data types.
(B) an abstract class defined in java.io.
(C) a class we can use to read primitive data types.
(D) an interface that defines methods to open files.

M

Mr. Dubey • 51.47K Points
Coach

Q. Which of the following method can be used to change the size of a JAVA.awt.Component object?

(A) dimension().
(B) setSize().
(C) area().
(D) size().

M

Mr. Dubey • 51.47K Points
Coach

Q. What method is used to specify a container's layout?

(A) setLayout().
(B) setSize().
(C) area().
(D) resize().

M

Mr. Dubey • 51.47K Points
Coach

Q. What will be the result of the expression : a % b~~~when a and b are of type int and their values are a = -17 and b = -6?

(A) -5.
(B) -23.
(C) 0.
(D) 5.

M

Mr. Dubey • 51.47K Points
Coach

Q. Choose the operations that can be performed on String objects:

(A) +=.
(B) -.
(C) %.
(D) ^.

M

Mr. Dubey • 51.47K Points
Coach

Q. (1 | 4) + (4 & 2) = ?(in base ten)

(A) 1.
(B) 5.
(C) 2.
(D) 8.

M

Mr. Dubey • 51.47K Points
Coach

Q. Given the declarations~~~boolean b;~~~short x1 = 100, x2 = 200, x3 = 300; Which of the following statement is evaluated to true?

(A) b = x1 * 2 == x2;
(B) b = x1 + x2 != 3 * x1;
(C) b = (x3 - 2*x2<0) && ((x3 = 400)<2**x2);
(D) b = (x3 - 2*x2>0) || ((x3 = 400) 2*x2);

M

Mr. Dubey • 51.47K Points
Coach

Q. Which of the following represent legal flow control statements?

(A) break;
(B) break();
(C) continue(inner);
(D) exit();

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.