and Answers| Latest Update
True or False: A class may have more than one constructor. ✔️✔️True; A class may have many
different constructors.
True or False: The programmer gives names to objects in his program. ✔️✔️True; A programmer
may give his objects any name.
True or False: When an object is created, the program always calls its "init" method. ✔️✔️False;
A subclass does not inherit any constructors.
What are three benefits of encapsulation? ✔️✔️1. The fields of a class can be made read-only or
write-only.
2. A class can have total control over what is stored in its field.
3. The users of a class do not know how the class stores its data. A class can change the data
type of a field and users of the class do not need to change any of their code.
True or False: A subclass inherits all the fields and public methods of its superclass. ✔️✔️True; a
subclass does inherit all the fields and public methods.
True or False: A subclass inherits all those constructors of its superclass that are not defined
explicitly in the subclass. ✔️✔️False; constructors aren't inherited.
True or False: The name of a class in Java must be the same as the name of its source file.
(excluding the extension ".java") ✔️✔️True; A class cannot have a different name than the source
file.
True or False: The names of classes are case-sensitive. ✔️✔️True; You must use the correct case
when naming classes.