I think question:
What is the result of code?
arrays are object so they can be cast to super class arrays. But casting to subclass occurs Runtime Exception.
public class Myclass {
public static void main(
String args[]) {
A[] arrA;
B[] arrB;
arrA = new A[10];
arrB = new B[10];
arrA = arrB;
arrB = (B[])arrA;
arrA = new A[10]; //arrA has A object array
arrB = (B[]) arrA; //Run time error occurs while casting to subclass
}}
class A{}
class B extends A{}