0
casting in arrays
If Person is super and Sudents extends Person code: Person personlist = new Person[1]; personlist[0] = new Student(); Is there a type casting?
1 Odpowiedź
+ 1
there is no casting, there is polymorphism
and it will throw an exception because array of length 1 has only index 0, not index 1