I have some problems with generic types. I don't understand why in this code all the calls to myTest point at:
public static <MyData> void myTest(Integer integer)
In some cases I specify the type between angle brackets:
tr.<Number>myTest(null); OR tr.<String>myTest(null);
But I expect that calls go to other methods.
this is my class:
public class MyTest {
public static void main(String[] arg){
MyTest tr = new MyTest();
tr.<Number>myTest(null);
tr.<MyTest>myTest(null);
tr.<String>myTest(null);
}
public static <Number> void myTest(Number number){
}
public static <MyData> void myTest(Integer integer){
}
public static void myTest(String string){
}
public static <String> void testClass(String string){
}
}
Thanks in advance!