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

回到话题: Sos! help me from Polymorphism, Interface & Inner classes...

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论