polymorphism tag

3 questions


1 answers
59 views
0
When is a virtual extinction used?

I understand that I have virtual attached to the constructor or other function,I don't know why virtual is used for extinction.When an object disappears, it automatically calls for an inherited class,...


1 answers
90 views
0
C++ Overriding, Polymorphism

Hello.The code I'm trying to do,class Shape { protected: int type; // POINT, CIRCLE, RECTANGLE, or TRIANGLE public: virtual double area()=0; virtual bool isContaining(const Point&)=0; enum {...


1 answers
75 views
0
Is List a subclass of List? Why is Java generic implicitly not guaranteed polymorphism?

It's confusing how Java Generics deals with inheritance and polymorphism.Let's say there's a hierarchy like this.Animal (Parent)Dog - Cat (child) Assuming that there is a DoSomething(List<Animal>...


© 2024 OneMinuteCode. All rights reserved.