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 three things to be safer online.
kenny6666 [7]

Answer:

1. do not give out your age

2. don't use your real name unless you are supervised

3.dont put all your information out there

5 0
3 years ago
Match the components of a blog to their descriptions.
motikmotik

Answer:

Explanation:

1. entry title - name of the posting

2. permalink - place where a blog posting is located

3. entry date - when the posting became available

4. comment - allows users to add to the conversation

3 0
2 years ago
Rapunzel s-a născut într-un ţinut îndepărtat într-un regat necunoscut. Mama vitregă a închis-o pe Rapunzel într-un turn foarte î
andrey2020 [161]
Iche hebie zaft no guts dude
5 0
3 years ago
Mary has cleaned her data and is ready to determine the most efficient bus route. She starts by splitting the city into four reg
igomit [66]

ANSWER:

B.

Transforming the data might help Mary notice a different pattern that makes a bigger impact on bus routes than regions of the City.

EXPLANATION:

Mary can check if there are other things or factors that might influence where the bus routes need to be prioritized. For example if the students' age is considered for the bus routes instead of regions. She can achieve this by

By Re-sorting or Transforming the data.

That is to say she will be able to find out if it is only region or if there are different patterns that makes bigger impacts on bus routes, by transforming the data.

8 0
3 years ago
On what basis can you categorize the generations of computers
3241004551 [841]

what the answer to this question....


7 0
3 years ago
Other questions:
  • You are given a data set with information from 1,000 high school students (of which the following is a part of the data) and ask
    6·1 answer
  • We never need to use a forward declaration when invoking a public subprogram. true or false?
    15·1 answer
  • Is using abbreviations and symbols in social media a problem? Why or why not?
    11·1 answer
  • What is the inverse function of d(x ) = -2x - 6?
    11·1 answer
  • Suppose you want to use an Internet cafe to login to your personal account on a bank web site, but you suspect that the computer
    15·1 answer
  • A _________ is automatically launched by some trigger and appears in front of the active window
    12·1 answer
  • How many of you got the right answer from this app​
    8·1 answer
  • ANYONE WANNA FRIEND ME ON DISCORD ゴRose joestarゴ#2088
    9·1 answer
  • Write IF() function for student 3, If total mark is greater than 10 then print
    12·1 answer
  • Continue your S3 and S4 assignment for a young soccer league with the following specification. Do not include the previous queri
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!