ClassF{ } Class A{ public void great(Object o){ System.out.print("yeah"); } } Class B extends A{ public void great(Object o){ System.out.print("ha"); } public void great(F o){ System.out.print("ha"); } } public class testing{ public static void main(String[] arg){ F f1=new F(); B b1=new B(); B.great(f1); } } Question: Why here overloading takes precedent than Overriding? and print "ha", since f is also an object, why doesn't it goes it the first great(object o) I think both of the great in class B works. Can you explain?.