You’re not instantiating a Number
. You’re instantiating a Number[]
. These are two completely different objects.
You can generally expect to be able to instantiate an array of any type, even types that you can’t directly instantiate yourself. You can populate these arrays through type inheritance and the is-a relationship.
For example, with the above, you could put any Number
in there you wanted – 1, 2.0, 1.4f, and so forth.
0
solved in java, why abstract class Number can be instantiated? [duplicate]