嗨,你可以试着读一读这个也许它会有帮助:
Short answer:
They are the same.
Long Answer, (and yet less revealing):
Polymorphism is simply the ability to have many different methods (Or functions,
for those who are used to C-Type programs) to have the same name but act differently
depending on the type of parameters that were passed to the function.
So for example, we may have a method called punch, which accepts no parameters at
all,
and returns an integer:
public int punch()
{
return 3;
}
We could also have a method named punch that accepts a String and returns a
boolean.
public boolean punch(String poorGuyGettingPunched)
{
if(poorGuyGettingPunched.equals("joe"))
{
System.out.println("sorry Joe");
return true;
}
else
return false;
}
That is called polymorphism... And strangely enough, it is also called overloading.