class A
{
void show()
{
System.out.println("show");
}
}
class B extends A
{
void disp()
{
System.out.println("disp");
}
}
class Prac2
{
public static void main(String args[])
{
A ob = new B();
ob.disp();
}
}
/*this thing shows an error */
now my question is :i thought we can use any object reference which must be above hierchy than the object which we are giving.but then here it shows an error...can some one pl explain object reference in detail because till now i use to think that they are only something like pointers but here they are acting differently