Which of the following statements are true? (Select 3 options.)
a A Java class can define multiple methods.
b A Java class can define multiple variables.
c A Java class can be defined in multiple packages.
d A Java class can import multiple packages.
e A Java class can’t define more than 108 constructors.
f End-of-line comments can’t follow import or package statements.
g Multiline comments can only be defined within a method definition.
Answer: a, b, d
Explanation: Option (c) is incorrect. The same class can’t be defined in multiple packages. If you try to define the same class—say, the class Person—in the packages com.ejava and com.eoracle, you’re defining two classes with the same name but in separate packages. In this case, com.ejava.Personand com.eoracle.Person will refer to two different classes.
Option (e) is incorrect because there is no theoretical limit on the number of constructors that can be defined by a class.
Option (f) is incorrect because end-of-line comments can follow any line of code.
Option (g) is incorrect because multiline comments can also be placed outside a method definition.