I know Java can get Method Object using the Reflection.getMethod(...) method,but the method needs method parameter types。 but I don't know the exact parameter type。e.g.
byte a = 20;
System.out.println(a);
the println method hasn't the overload method println(Byte),but has println(Int)。
How to get the println method through the byte type?
the other example
class MyClass
{
}
class MyClass1 extends MyClass
{
}
class TestClass
{
public static void method1(MyClass c)
{
... ...
}
}
TestClass.method1(new MyClass1()) is correct.but can i get the method1 through parameter type MyClass1 ?
Class.getMethods will get all method in Class, too much。 can i get all overload method same name?