class ApBase implements Runnable {
publicvoid run() {
}
}
publicclass MainClass {
publicstaticvoid main(String[] argv) {
ApBase aBase = new ApBase();
Runnable aR = aBase;
Object obj = aR;
ApBase x = (ApBase) obj;
}
}
A. The compiler objects to line 2.
B. The compiler objects to line 3.
C. The code compiles but when run throws a ClassCastException in line 4.
D. The code compiles and runs without a problem.