14 lines
197 B
Text
14 lines
197 B
Text
/* Test legal downcasts */
|
|
|
|
class A { }
|
|
class B extends A { }
|
|
|
|
class Main {
|
|
void main() {
|
|
A a;
|
|
B b;
|
|
a = new B();
|
|
b = (B) a; /* OK at runtime */
|
|
write(0);
|
|
}
|
|
}
|