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
Debate whether social networking is harmful or helpful to society.
Dmitriy789 [7]

Answer:

I believe that Social Networking <em>IS </em>helpful to society, but, people use it for wrong stuff.

5 0
2 years ago
Could someone tell me what this means in python? Thanks
alexandr1967 [171]

a python is a snake not a launguage

3 0
3 years ago
2 When you add text with the Text Tool, __________. the text is added to the current layer a new floating selection layer is cre
Basile [38]

Answer:

A new floating selection layer is created

Explanation:

In a graphic design software for example like CorelDraw, if  a text tool is used to add text, a new floating selection layer is created in which, the text is inserted.

8 0
3 years ago
1. The letters that appear after the dot after a file name are called the:
Murrr4er [49]

Answer:

Files Extension.

Explanation:

The letters that follow the period at the end of a file name are the file's extension. This enables the computer to know what application it should use to read the file.

7 0
2 years ago
Workers in a child care facility or preschool are part of what career path?
dedylja [7]

Answer:

A

Explanation:

Preschool teachers show education

8 0
3 years ago
Read 2 more answers
Other questions:
  • In Oracle, _____ make(s) it possible to merge SQL and traditional programming constructs, such as variables, conditional process
    5·1 answer
  • if you want to present slide to fellow student or co-workers, wich productivity software should you use to create them?
    7·1 answer
  • Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binar
    11·1 answer
  • What is the difference between cout and cerr?
    14·2 answers
  • Study the sentences below. A.Changing the properties of characters in a sentence or paragraph in a Word document helps increase
    5·2 answers
  • ICD-10-CM diagnosis codes are entered in Block 21 of the CMS-1500 claim. A maximum of __________ ICD-10- CM codes may be entered
    14·1 answer
  • An individual posing as an online gamer accesses information stored in an unsuspecting user’s computer by placing a program in h
    11·1 answer
  • If you said the bottom margin, you are talking about what?
    13·2 answers
  • When using a small mic that attaches to your interview subject, where should you place that mic and why?
    5·1 answer
  • Write a function float Average(int, int) that finds the mean, and then write a main program that inputs two numbers from the use
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!