object is the main class
string and stringbuffer are the child classes
String s =new String("java");
object o=(object)s
Rule: A b=(C)d
Rule1: the type C and d must hava some relationship either same type or parent to child or child to parent, otherwise we will get compile time error
Rule2: C must be same are derived type od A other we will get compile time error
Rule3: the underlying object type of d must be same or derived type of c other wise we will get run time exception
any one can explain me in short and easy method