All the elements in Java array should be of the same type except for cases allowed by polymorphism.
When you create an array, you should specify the type of elements that can be contained in it. If it is not a primitive type but a type defined through some class, then the actual array, in addition to objects of the specified class, may also contain objects of the classes that are, in turn, subclasses of the class that was specified in the initial array declaration.
http://javapd.blogspot.com/
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать