Tuesday, 2 April 2013

Array - 13




class A {}
class B {} extends A {}
public class C
{
public static void main(String args[]) throws ClassCastException
{
A[] arrA;
B[] arrB;
arrA=new A[10];
arrB=new B[20];

// arrA=arrB;
// arrB=(B[]) arrA;

// arrA=new A[10];
// arrB=(B[]) arrA;
}
}

No comments:

Post a Comment