class Base {}
class Sub extends Base {}
class Sub2 extends Base {}
public class CEx{
public static void main(String argv[]){
Base b=new Base();
Sub s=(Sub) b;
}
}
this gives run time error, Sub is subclass of
Base,would this work
if any instance of Base can receive the value of
Sub but not vice versa,is this only possible for
widening conversion for primitives?