//if line (222) is a compile time error then WHY DOES line (111) //throw an Exception at runtime instread of a compile time error //?!?
public class c1{
public static void main(
String[] args) {
ApBase base = new ApBase();
Inf i = (Inf) base; //line (111)
String s = new String("hi all");
Inf i2 = (Inf) s; //line (222)
}
}
class ApBase extends Object {}
class ApSomeOther extends ApBase implements Inf {
public void amethod() {}
}
interface Inf { public void amethod(); }