Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

7. List behaviors to improve effective leadership in meetings

Answered: 1 week ago

Question

6. Explain the six-step group decision process

Answered: 1 week ago