Explore topic-wise MCQs in Java Programming.

This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your Java Programming knowledge and support exam preparation. Choose a topic below to get started.

1.

Which two statements are true about or classes?

A. 1 and 2
B. 2 and 3
C. 3 and 4
D. 4 and 5
Answer» E.
2.

Which of the following will produce an answer that is closest in value to a double, , while not being greater than ?

A. (int)Math.min(d);
B. (int)Math.max(d);
C. (int)Math.abs(d);
D. (int)Math.floor(d);
Answer» E.
3.

What will be the output of the program?

A. 1 and 3
B. 2 and 4
C. 3 and 4
D. 1 and 2
Answer» B. 2 and 4
4.

What will be the output of the program? How many String objects have been created?

A. 2
B. 3
C. 4
D. 5
Answer» D. 5
5.

What two statements are true about the result obtained from calling ?

A. 1 and 2
B. 2 and 3
C. 3 and 4
D. 4 and 5
Answer» C. 3 and 4
6.

Which of the following are valid calls to ?

A. 1, 2 and 4
B. 2, 3 and 4
C. 1, 2 and 3
D. 3 and 4
Answer» B. 2, 3 and 4
7.

Select how you would start the program to cause it to print:

A. java Myfile 222
B. java Myfile 1 2 2 3 4
C. java Myfile 1 3 2 2
D. java Myfile 0 1 2 3
Answer» D. java Myfile 0 1 2 3