Important Java Mcq 1

Every Java application is composed of at least one?

a. Local variable

b. Instance variable

c. Public class declaration

d. Imported class

Answer:

c. Public class declaration

Explanation

In any Java program there must be a public class. As we know the program execution starts from the main method and the class of this main method is public. Although we don’t declare the class as public by default, it will be public only.

Related MCQs
Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?