package test;
public class Test {
public static void main(String[] args) {
First[] first = new First[5];
Second[] second = (Second[]) first;
}
}
class First {
}
class Second extends First {
}
Exception in thread "main" java.lang.ClassCastException: [Ltest.First; cannot be cast to [Ltest.Second]
Prečo cannot be cast??