Question
1. Assuming that class B inherits from class A , which of the following is correct? a. An object of class A is an object
1. Assuming that class B inherits from class A, which of the following is correct?
a. An object of class A is an object of class B
b. None of these is correct.
c. An object of class B is an object of class A.
2. What keyword do we use in the class header that inherits from an interface?
a. implements
b. interfaces
c. modifies
3. Why does Java provide a protected access modifier?
a. To hide methods from the client classes
b. All of these are correct.
c. To hide fields from client classes
4. Why would you want to override a method?
a. It allows you to hide features of the subclass using the super keyword.
b. It allows you to hide features of the superclass that you want to change.
c. It allows you to invoke the base case method.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started