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
SashulF [63]
3 years ago
12

A bear is an animal and a zoo contains many animals, including bears. Three classes Animal, Bear, and Zoo are declared to repres

ent animal, bear and zoo objects. Which of the following is the most appropriate set of declarations?
a) public class Animal extends Bear
{
...
}
public class Zoo
{
private Animal[] myAnimals;
...
}
b) public class Animal extends Zoo
{
private Bear myBear;
...
}
c) public class Bear extends Animal, Zoo
{
...
}
d) public class Bear extends Animal implements Zoo
{
...
}
e) public class Bear extends Animal
{
...
}
public class Zoo
{
private Animal[] myAnimals;
...
}
Computers and Technology
1 answer:
givi [52]3 years ago
7 0

Answer:

a) public class Bear  extends Animal{ ... }

public class Zoo {  private Animal[] myAnimals;

... }

Explanation:

The question is an illustration of inheritance in Java programming language.

The syntax to follow is:

class subclass extends superclass {...}

From the question:

Bear \to subclass

Animal \to superclass

So, the following declaration will be used:

class Bear  extends Animal{ ... }

Also from the question, the zoo object represents collection of many animals.

So, its declaration will follow:

class class-name{ ..... }

i.e.

class zoo{ .... }

The ... can then be replaced with declaration of each animal or an array to represent the declarations..

<em>Hence, (e) is correct</em>

You might be interested in
Next, Jamal wants to copy text from a Word document to the slide he just added. He outlines the steps to complete his task. Step
Misha Larkins [42]

Answer:place an insertion point/after step 2

Explanation:I just took the quiz

3 0
4 years ago
Read 2 more answers
At one college, the tuition for a full-time student is $6,000 per semester. It has been announced that the tuition will increase
Alina [70]

Answer:

  1. var projected_fee = 6000;  
  2. for(var i = 1; i <= 5; i++){
  3.    projected_fee = projected_fee * 0.02 + projected_fee;
  4.    console.log("$" + projected_fee.toFixed(2));
  5. }

Explanation:

Firstly, create a variable, projected_fee, and set the initial tuition fee value to it (Line 1).

Next, user a for loop that run for 5 times to repeatedly calculate the projected_fee based on 2 percent of increment rate (Line 4) and display the projected fee to console terminal (Line 5). The output should be

$6120.00

$6242.40

$6367.25

$6494.59

$6624.48

8 0
3 years ago
Which of the following is the first step in a lockout-and-tag procedure? A. Place your lock on the breaker or switch. B. Sign yo
yKpoI14uk [10]
The answer is C. Shut off the Electricity to the machine at the breaker m. hope this helps
4 0
4 years ago
Read 2 more answers
LAST TIME ASKING FOR APPS THAT ARE FREE THAT I DONT NEED TO PAY THE APPS HAVE TO HELP ME STOP VIRUSES FROM MY PHONE PLZ HELP THE
pashok25 [27]

Answer:

i wish i could help u but i cant find a "free" one

Explanation:

4 0
3 years ago
Read 2 more answers
What are horizontal and vertical page break? how and where are these inserted?​
Elena L [17]

A. Do this. horizontal page breaks. select the row that is underneath the row where you want the page to break vertical page break....

B. on the layout lab, under page set up, click breaks, and then click insert page break.

Explanation:

DO ONE OF THE FOLLOWING: TO INSERT

4 0
4 years ago
Other questions:
  • What might happen if a computer has too many applications running at one time?
    15·1 answer
  • Group technology identifies components by a coding scheme that specifies the
    13·1 answer
  • What is the maximum rate at which computers A and B can communicate, via router X? (your answer should be in Mbps)
    12·1 answer
  • Write a for loop that sets each array element in bonusScores to the sum of itself and the next element, except for the last elem
    11·2 answers
  • Write the definition of a function named swapints that is passed two int variables. The function returns nothing but exchanges t
    8·1 answer
  • Match the image to the view type in a presentation program. scroll bar tool bar status bar menu bar provides an array of buttons
    10·2 answers
  • What are some potential challenges that society will face given the digital revolution? You may want to think particularly of th
    10·1 answer
  • Need the answer ASAP!!! I’ll mark brainliest if correct
    5·1 answer
  • How to change your username in brainly​
    12·2 answers
  • WILL GIVE A BRAINLIEST!!! PLS HELP!!!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!