1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jonny [76]
3 years ago
10

For this exercise, you are going to create a part of an Animal hierarchy. Unlike some of our examples and the previous exercises

, this exercise is going to have 3 levels in the hierachry.
At the top is the Animal class. Below that, we are going to have a subclass for Pets. Under pets, we are going to have 2 subclasses, Dogs and Fish.
You will need to create your class hierarchy and add instance variables, getters, and setter methods to accommodate the following information:
I need to save what type of animal I have (String variable)
I want to be able to save a name for my fish and dog (String variable)
I want to know which fish need salt water v. fresh water (String variable)
I want to know if my dog has been trained (boolean variable)
I want to know the size of my dog and fish (String variable)
Make sure you use common sense names for your variables!
public class Animal
{
}
public class Fish extends Pet public class Pet extends Animal public class Dog extends Pet
{ { {
} } }
Computers and Technology
1 answer:
kati45 [8]3 years ago
5 0

Answer:

vehicle super class 9.1.4

Explanation:

So you need to create a super class containig all the animals use the class above for referance

You might be interested in
List 2 advantages Cryptocurrency have over regular bank transactions
ratelena [41]

Answer:

low transaction fees and speedier processing

Explanation:

5 0
2 years ago
Read 2 more answers
What is the user requirements of an educational app
VARVARA [1.3K]
Ummmmm I don’t know but I wanna know now.....
7 0
3 years ago
To insert an endnote, which steps should you follow?
Evgesh-ka [11]
<span>To insert an endnote, you should follow he following steps:
A.Place the cursor in the document where you want the note reference mark to appear, select Insert Endnote command from the Reference tab in the Footnotes group.
Correct answer: A
</span><span>This way a reference mark would be added in the text and the endnote will be added at the end of the document.</span>
6 0
3 years ago
1. A pure aggregator is best defined as a blog that
miss Akunina [59]
A pure aggregator is best defined as a blog that aggregates blog content from other sources.

An Aggregator blog or website don't write its own content. It aggregates information or content from third-party websites. There are different types of aggregator websites such as a poll aggregator, a review aggregator, and a search aggregator.
5 0
3 years ago
A search engine is giving you too many sites that are not relevant to your topic, how cell phones change culture. Placing quotes
Pie

Answer:

All of the above.

Explanation:

Regards: Your Friendly Study Co-Pilot!

5 0
3 years ago
Read 2 more answers
Other questions:
  • What is an enterprise system
    14·2 answers
  • With respect to PERT and​ CPM, slack A. is a task or subproject that must be completed. B. marks the start or completion of a ta
    9·1 answer
  • Which of the following statements is NOT true about a mainframe computer?
    14·1 answer
  • The___provides access to the internet; may also be internal
    11·1 answer
  • The largest type of computer system with the most extensive storage capacity and the fastest processing speeds is a ________.
    7·1 answer
  • Which statement in main() generates an error?
    15·1 answer
  • World pade is world processing software true or false​
    15·1 answer
  • Ses
    15·1 answer
  • . Which of the following refers to the informal rules for how to behave online? A.
    9·1 answer
  • Would my phone still work if I snapped it in half?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!