Let me try.

old (HH)
Let me try to explain in English. I try to make things simple and hope it will be a little help for you and not make you confuse more.

As far as I know, virtual function is used in C++ to realize the polymorphism, not in Java. So I do not disccuss about virtual function here. But it is definitely helpful for you to understand polymorphism if you understand virtual function in C++.

Simply to say, polymorphism in Java is one way that enables you to define methods with objects (let us call them object parameter) as their parameters and you can pass any objects which is in the inheritant tree rooted from an object parameter to the methods.

For example:

base calss A;
derived class B : A;
derived class C : A;

class D {
method(A a) {

You can call D::method(A a) as following:

B b;
C c;
D d;
2000-11-28 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: Sos! help me from Polymorphism, Interface & Inner classes...

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论