this is from jls 2.0 chap.5.5:and I think its a mistake in their text
" The detailed rules for compile-time correctness checking of a casting conversion of a value of compile-time reference type S (source) to a compile-time reference type T (target) are as follows: (T)S
....
* If S is an interface type:
o If T is an array type, then T must implement S, or a compile-time error occurs. "
(WRONG !!! IF ITS AN ARRAY TYPE YOU ALWAYS GET ERROR !!!)
the example below:
class T implements S
{
public void foo(){System.out.println("it works");}
}
interface S{void foo();}
class TestCast {
public static void main(
String args[]){
T[] bigT=new T[100];
T t;
bigT=(T[])s;
}
}
gives a compile error
Can please someone comment on this...