You have to declare a variable of type Interface I.
Look at the following code.
interface I{
}
class Super{
}
public class abcde extends Super implements I{
public static void main(String args[]){
I i = null;
Super s=(Super)i;
}
}
Originally posted by Neha Sawant:
hi,
why is this not compiling.
i am getting undefined variable I on the last line.
Can anyone tell me what am i missing
interface I{
}
class Super{
}
public class abcde extends Super implements I{
public static void main(String args[]){
Super s=(Super)I;
}
}