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
Зарегистрируйся сейчас
или Подпишись на будущие тесты