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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!