Question
1. Define the term abstract class in your own words. 2. Can an abstract class be instantiated? For example, if we have an abstract class
1. Define the term
abstract class
in your own words.
2. Can an abstract class be instantiated? For example, if we have an abstract class Animal,
can we instantiate it in our main program by saying something like this?
Animal fuzzyAnimal = new Animal();
3. Can a class be abstract even if you dont include the reserved word abstract in the class
header?
4. What are some ways that abstract classes and interfaces are different?
5. What are some ways that abstract classes and interfaces are similar?
6. What is meant by the term single inheritance?
7. How does single inheritance fuel the need for Java to include both abstract classes and
interfaces (as opposed to one or the other)?
8. Suppose that you write code (say a Cat class) that extends an abstract class (say an
Animal class) and you dont override the abstract methods. What will happen when you
compile your code?
9. Whats the benefit to using an abstract class in a programming solution?
10. Suppose that you write code for an interface (say the interface Valuable) and include a
full method implementation in the interface code. What will happen when you compile
your code?
11. Suppose that you write code for an interface (say the interface Valuable) and then you
implement the interface in a concrete class (say a class Gold). What happens if you dont
provide the full method implementation for all of the methods specified by the interface?
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