Java Chapter 10 Test Questions with Verified
Solutions
Which of the following statements depicts the valid format to call a superclass constructor from
a subclass constructor? ✔️✔️super(name, score);
If jrStudent is an object of Student, which of the following statements will result in a value of
true? ✔️✔️jrStudent instanceof Student
Which statement correctly declares a sedan object of the Car class? ✔️✔️Car sedan = new Car();
You would like to make a member of a class visible in all subclasses regardless of what package
they are in. Which one of the following keywords would achieve this? ✔️✔️protected
A way to discover which of two classes is the base class and which is the subclass is to _____.
✔️✔️try saying the two class names together in a sentence with the phrase "is a(n)
Employing inheritance reduces errors because _____. ✔️✔️many of the methods you need have
already been used and tested
A base class can also be called a _____. ✔️✔️Superclass
Which of the following choices is the best example of a parent class/child class relationship?
✔️✔️Dog/Poodle
The Java keyword that creates inheritance is _____. ✔️✔️Extends
, A class named Building has a public, nonstatic method named getFloors(). If School is a child
class of Building, and modelHigh is an object of type School, which of the following statements
is valid? ✔️✔️modelHigh.getFloors();
Which of the following statements is true? ✔️✔️A child class inherits from a parent class.
When a subclass method has the same name and argument types as a superclass method, the
subclass method _____ the superclass method. ✔️✔️Overrides
When you instantiate an object that is a member of a subclass, the _____ constructor executes
first. ✔️✔️Parent class
The keyword super always refers to the _____ of the class in which you use it. ✔️✔️Parent class
If the only constructor in a superclass requires arguments, its subclass _____. ✔️✔️must contain
a constructor
Programmers and analysts sometimes use a graphical language called _____ to describe classes
and object-oriented processes. ✔️✔️Unified Modeling Language
In Java, using the same method name to indicate different implementations is called _____.
✔️✔️polymorphism
In Java, the concept of keeping data private is known as _____. ✔️✔️information hiding
If a method has been overridden but you want to use the superclass version within the
subclass, you can use the keyword _____ to access the parent class method. ✔️✔️Super
Within a subclass, you cannot override _____ methods. ✔️✔️Static
Solutions
Which of the following statements depicts the valid format to call a superclass constructor from
a subclass constructor? ✔️✔️super(name, score);
If jrStudent is an object of Student, which of the following statements will result in a value of
true? ✔️✔️jrStudent instanceof Student
Which statement correctly declares a sedan object of the Car class? ✔️✔️Car sedan = new Car();
You would like to make a member of a class visible in all subclasses regardless of what package
they are in. Which one of the following keywords would achieve this? ✔️✔️protected
A way to discover which of two classes is the base class and which is the subclass is to _____.
✔️✔️try saying the two class names together in a sentence with the phrase "is a(n)
Employing inheritance reduces errors because _____. ✔️✔️many of the methods you need have
already been used and tested
A base class can also be called a _____. ✔️✔️Superclass
Which of the following choices is the best example of a parent class/child class relationship?
✔️✔️Dog/Poodle
The Java keyword that creates inheritance is _____. ✔️✔️Extends
, A class named Building has a public, nonstatic method named getFloors(). If School is a child
class of Building, and modelHigh is an object of type School, which of the following statements
is valid? ✔️✔️modelHigh.getFloors();
Which of the following statements is true? ✔️✔️A child class inherits from a parent class.
When a subclass method has the same name and argument types as a superclass method, the
subclass method _____ the superclass method. ✔️✔️Overrides
When you instantiate an object that is a member of a subclass, the _____ constructor executes
first. ✔️✔️Parent class
The keyword super always refers to the _____ of the class in which you use it. ✔️✔️Parent class
If the only constructor in a superclass requires arguments, its subclass _____. ✔️✔️must contain
a constructor
Programmers and analysts sometimes use a graphical language called _____ to describe classes
and object-oriented processes. ✔️✔️Unified Modeling Language
In Java, using the same method name to indicate different implementations is called _____.
✔️✔️polymorphism
In Java, the concept of keeping data private is known as _____. ✔️✔️information hiding
If a method has been overridden but you want to use the superclass version within the
subclass, you can use the keyword _____ to access the parent class method. ✔️✔️Super
Within a subclass, you cannot override _____ methods. ✔️✔️Static