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
Write a Python program called wdcount.py which uses a dictionary to count the number of occurrences of each word (ignoring case)
Art [367]

The program is an illustration of loops.

<h3>What are loops?</h3>

Loops are program statements used to perform repetition

<h3>The wordcount.py program</h3>

The program written in Python, where comments are used to explain each line is as follows

# This opens the file in read mode

text = open("myFile.txt", "r")

# This creates an empty dictionary

d = dict()

#This iterates through the text

for line in text:

# This splits the line into words, after removing leading & trailing spaces, and newline characters

words = line.strip().lower().split(" ")

# This iterates through all the words

for word in words:

 # The following if condition counts the occurrence of each word

 if word in d:

  d[word] = d[word] + 1

 else:

  d[word] = 1

#This prints the words and their frequencies, in descending order

for w in sorted(d, key=d.get, reverse=True):

   print(w, d[w])

Read more about loops at:

brainly.com/question/16397886

5 0
2 years ago
Explain the limitations of the old economy<br>​
pickupchik [31]

Explanation:

Time Constraint and Time Consuming: Nobody would carry out business when the market was closed. ... Limited Space: The old economy depended on physical space such as market places and offices before business transaction could take place.

7 0
3 years ago
What is the name of situation where the same data is stored unnecessarily at different places?
Delicious77 [7]

Answer:

Data redundancy.

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.

In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.

Data redundancy is the name of situation where the same data is stored unnecessarily at different places.

Simply stated, data redundancy can be defined as a condition which typically involves storing the same data in multiple storage locations. Thus, data redundancy connotes the unnecessary repetition of the same piece of data (informations) either deliberately or for some specific reasons.

3 0
3 years ago
.Choose the extention of Scratch Project<br><br><br> .sb2<br><br> jpeg<br><br> .exls
Ratling [72]

Answer:

I know about .sb3, and it similar to .sb2

that might be your answer.

Explanation:

jpeg is for pictures and .exls is Microsoft's excel

extension.

4 0
3 years ago
Read 2 more answers
Who is willam afton from five nights at freddy
diamong [38]

Answer:

the man behind the murder

8 0
3 years ago
Read 2 more answers
Other questions:
  • Given the plaintext {0F0E0D0C0B0A09080706050403020100} and the key {02020202020202020202020202020202}: a. Show the original cont
    11·1 answer
  • Which of the following provides astronomical evidence for the age of the earth?
    11·1 answer
  • Suppose a developer gets class XYZ files and documentation from a subcontractor. This class does not implement the Comparable in
    9·1 answer
  • A user is connecting to an e-commerce server to buy some widgets for a company. the user connects to the site and notices there
    10·1 answer
  • Assume s is a string of lower case characters.
    15·1 answer
  • Which of these consoles have 64 bit architecture
    13·1 answer
  • What is transmission control protocol?
    9·2 answers
  • "3. 4. Simple number search We will pass you 2 inputs an list of numbers a number, N, to look for Your job is to loop through th
    5·1 answer
  • How can we compare a computer with human beings?
    14·1 answer
  • // This pseudocode segment is intended to compute the number
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!