Should all the elements in Java arrays be of the same type?
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.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Java
Зареєструйся Зараз
або Підпишись на майбутні тести