hi jitender,
for more clarification, a small example :
package mypackage;
class Parent
{
//Parent(String str){}
public static void XYZ(){ System.out.println("Parent XYZ");}
}
public class Child extends Parent
{
public static void XYZ(){System.out.println("Child XYZ");}
public static void main(String[] args)
{
Parent ch = new Child();
ch.XYZ(); // Special Line
}
}
if u change the statement at special line
1. Parent ch = new Child();
ch.XYZ(); // Special Line
Output is ----> Parent XYZ
2. Parent ch = new Child();
Parent.XYZ(); // Special Line
Output is -----> Parent XYZ
3. Child ch = new Child();
Child.XYZ(); // Special Line
Output is -----> Child XYZ
try some more combinations, so that u can understand better. hope it helps.
Chandu.