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
goldenfox [79]
3 years ago
15

If I have an Animal superclass with a Mammal subclass, both concrete and both having a method called eat() with identical signat

ures and return types, polymorphism means:________.
a. the Animal version of eat() will be called, regardless of the static/dynamic type.
b. the Mammal version of eatſ) will be called, regardless of static/dynamic.
c. the dynamic type of the reference will determine which of the methods to call.
d. the static type of the reference will determine which of the methods to call.
Computers and Technology
1 answer:
Katarina [22]3 years ago
5 0

Answer:

(c) the dynamic type of reference will determine which of the methods to call.

Explanation:

Polymorphism in Object Oriented Programming typically means the same method name can cause different actions depending on which object it is invoked on. Polymorphism allows for dynamic binding in that method invocation is not bound to the method definition until the program executes.

So in the case of Animal superclass and Mammal subclass, both having a method called eat() with identical signatures and return types, depending on which reference, the correct method eat() will be called dynamically upon execution.

For example, if we have the following;

================================

<em>Mammal mammal = new Animal();</em>

<em>mammal.eat()</em>

================================

The eat() method that will be called is the one in the Mammal subclass.

However, if we have;

================================

<em>Animal animal = new Animal();</em>

<em>animal.eat()</em>

================================

The eat() method of the Animal superclass will be called.

You might be interested in
Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and en
aleksandrvk [35]
I guess the answer True
3 0
3 years ago
The ____________ is the number of rectangles an image has in a square inch.
miv72 [106K]
D size




Read more




































Hope,this helped
7 0
3 years ago
Read 2 more answers
Consider the following code:
Deffense [45]

Answer:

The output of C is 102.

100 + 1 + 1 = 102

8 0
3 years ago
You may declare an unlimited number of variables in a statement as long as the variables are ____.
k0ka [10]

Answer:

b. the same data type

Explanation:

Any number of variables can be declared in a statement as long as the variables have the same data type. For example:

1) int a,b,c,d,e;

Here each of the declared variables a,b,c,d,e have the type int.

2) char p,q,r,s,t,u,v,w;

In this case variables p to w all have the type char.

3) float x,y,z;

x,y and z are all of type float.

6 0
3 years ago
Which of the following statements best describes IT careers?
DiKsa [7]

The answer is (C) IT careers are found in a wide variety of industries.

Nowadays, all types of industries in various different parts of the world will have an IT (information technology) department because it is needed, since most businesses operate using some form of IT equipment, which, most commonly found is a computer. It is a particularly lucrative field because of the wide array of job availability.

7 0
3 years ago
Other questions:
  • Select the correct answer.
    15·1 answer
  • While you are working with a document using a program such as wordpad, the document is stored in ___________?
    15·2 answers
  • What is the most consistent item regardless of the software used in BI?
    5·1 answer
  • The algorithm ADDN implements N-bit fixed-width binary addition for non-negative integers and ignores overflows. For example, AD
    13·1 answer
  • You're working in a table that has three columns and five rows. Since the first row will be a header row, you want it to span al
    5·1 answer
  • Deleting anitem from a linked list is best when performed using two pointersso that the deleted item is freed from memory.
    7·1 answer
  • fill in the balenkes ) 1)there are ................................... function keys on the keybord 2)pressing the end key moves
    6·1 answer
  • The chief intellectual property officer (CIPO) is responsible for collecting, maintaining, and distributing the organization's k
    14·1 answer
  • Chegg Suppose the heap is a full tree, size 2^n-1. what is the minimum number of steps to change a min heap to a max heap. Show
    5·1 answer
  • Sub to the channel plz plz
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!