For example:
List<String> items = new ArrayList<String>();
String[] aItems = items.toArray(); // type error, because toArray() returns Object[]
I understand that this is the way it is, and it cannot be changed. Of course I can cast it to String[], but I wonder what is the idea behind it? Is this a "bug" in Java, or is there a good reason for it?