Code: Select all
public class CastingExample{
public static void main(String[] args){
Printable p = null;
BlackInk black = new BlackInk();
p = (Printable)black;
}
}
class Ink {}
interface Printable{};
class ColorInk extends Ink implements Printable{}
class BlackInk extends Ink{};
What am I missing here?? Please explain it to me