16 lines
194 B
Text
16 lines
194 B
Text
|
// Test that arrays are not covariant
|
||
|
|
||
|
class Main {
|
||
|
void main() {
|
||
|
boolean y;
|
||
|
A[] Array1;
|
||
|
B[] Array2;
|
||
|
Array2 = new B[10];
|
||
|
|
||
|
Array1 = Array2;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class B extends A {}
|
||
|
|
||
|
class A {}
|