0
Массив
Если вначале массива мы пишем int[]. Зачем после объявления new int [] мы опять пишем тип данных int???
1 Answer
+ 4
While int is already specified when declaring the variable, the compiler does not automatically assume that whatever instance of the type created by 'new' belongs to the declared data type. Consider class A and class B where B inherits from A. This makes it possible to do:
A obj = new B();



