Explore topic-wise MCQs in General Principles .

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

1.

Which two cause a compiler error?

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

Which two of the following are legal declarations for nonnested classes and interfaces?

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

What is the widest valid returnType for methodA in line 3?

A. int
B. byte
C. long
D. double
Answer» E.
4.

Which three are valid method signatures in an interface?

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

Which of the following is/are legal method declarations?

A. 1 and 3
B. 2 and 4
C. 1 only
D. All of them are legal declarations.
Answer» E.
6.

Which three form part of correct array declarations?

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