Edit : do not read this i AM stupid :)
i have classes animal and dog
public class animal{
public static String getTitle(){ return "bla"; }
}
public class dog extends animal{
public static String getTitle(){ return "bla2"; }
}
when i do
animal p1=new animal();
animal p2=new dog();
System.out.println(p2.getClass().getDeclaredMethod("getTitle"));
i get
Main.java:16: unreported exception java.lang.NoSuchMethodException; must be caught or declared to be thrown
System.out.println(p2.getClass().getDeclaredMethod("getTitle"));
however if i do getDeclaredMethods getTitle is listed there.
am i stupid or just another reason to hate Java ?