Important Java Mcq 1

Which of the following is true? 

a. In java, an instance field declared public generates a compilation error.

b. int is the name of a class available in the package java.lang

c. Instance variable names may only contain letters and digits.

d. A class has always a constructor (possibly automatically supplied by the   java compiler).

Answer:

d. A class has always a constructor (possibly automatically supplied by the java compiler).

Explanation:

 In java, an instance field declared public generates a compilation error. Instance variable names may only contain letters and digits. A class has always a constructor (possibly automatically supplied by the java compiler). The more comments in a program, the faster the program runs.

Related MCQs
Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?