class A{}
class B extends A{}
class
Test {
public static void main(
String args[])
{
A a1 = new A();
B b1 = new B();
A a1 = (A)b1; //after executing this the right hand side will
//have object of type A or B
//i.e the ref gets casted or the object itself
//gets casted
}
}