posted 17 years ago
Hi Varma,
When you invoke a overloaded method, the compiler will try to invoke the method, from which we can invoke the other overloaded method. (ie., from that method, it can invoke the other method with the same name, in this case, from the method public void myTest(String s), we can invoke the other method public void myTest(Object o))
Due to this, it is invoking public void myTest(String s). If you declare one more method as follows means,
public void myTest(StringBuffer strBuffer) {
}
compiler will throw error, because compiler will get confused, and it doesn't know to invoke which method.
Regards,
Loga