in java if a parent class and child class has method with the same name and if an object of child class is made and method is called for that object then why the parent's method is executed ?? for example
public class parent
{
public void a(){
System.out.println("i am parents method");
}
public class child {
public void a()
{
System.out.println("i am child's method");
}
public static void main(string[] args)
{
child c1=new child();
c1.a();
}
when child calls method a() the method of child class should be executed but why it does not happens ?? why the parent;s method a() is executed??
plzz reply soon