полиморфизм

java polymorphism

Using a child class as a parent class An important aspect of polymorphism is the ability to use an object of a child cla ... the times I ask this question, and preferably an example, and a good article and a task on the topic of polymorphism. Thanks.

C++, polymorphism, and smart pointers

I have a poor understanding of how smart pointers (especially shared_ptr) interact with polymorphic types. The overall pictur ... // ... } } int main() { shared_ptr<Base> base = make_shared<Derived>(); do_something(base); }

Creating a class object in Java

I started to understand polymorphism and found the following example: there is a class Soldier, and General is its heir. The ... tHealth() ? And if the getSlogan() method was in the soldier, would such a call be possible? And this is due to polymorphism?

Can't understand polymorphic method call

I have a class Pair: public class Pair { public void getObject(Object o){ System.out.println("Text from Pair");} ... for the Detail object, the getObject method is called from the Pair class, why so? How exactly does a method call work here?

Java, the definition of " polymorphism"

I'm learning Java. I realized that I can't properly define polymorphism. I Googled, found a lot of definitions, but they are ... rphism allows you to abstract from specific implementations of methods. The point is to give a definition without examples.

Understand polymorphism correctly

Hello everyone Help us understand polymorphism correctly. Since there are many examples on the Internet and they all differ f ... e I understood both in the first example and in the second example, polymorphism is shown , and this type is called override.

Where is static polymorphism implemented in the code?

The teacher asked the question, in which line of this code (C++) is static polymorphism implemented? The teacher also said th ... (); polar.show_timer(); polar.show_pulse(); polar.show_calories(); _getch(); return 0; }

Help with Python polymorphism

Help me understand the code. I can not understand its principle of operation. class Base: def __init__(self,N): ... 1 obj.out() 0 0 1 1 2 ---- 2 ---- ---- 3 ---- 3 4 4 What is the principle of print output? why only up to 4 outputs?

An example of polymorphism in Java from the book Java Philosophy

public class Example { public static void main(String[] args) { Circle circle = new Circle(); ... the type and parameter of the Shape class in the Shape shape method and we don't care what shape it is what is the parameter?

What is polymorphism and what are its main types?

I'm starting out as a programmer. They told me to learn polymorphism. I started reading from different sources, but it is not ... aces is when the other two are associated with parameters and Parametric is true, and Ad hoc is its imaginary form as I read.

Planetary system simulation

The task is to use the concepts of OOP on the example of at least 5 classes that contain at least 4 functions: encapsulation, ... ~SizePlanet() { delete [] ArrSizePlanet; } void SizePlanet::addSizePlanet() { } void SizePlanet::SortSizePlanet() { }