One can instantiate a class by simply calling the constructor, like
Point(1, 2). The
new in front is not needed.
One can write the constructor name, without new, to instantiate a class
The constructor name needs to come after the keyword new to instantiate a class
CorrectionHere is what's right.
One cannot call the constructor without using the
new in front stands for the object allocation,
the constructor performs the subsequent object initialization.
Those two parts are inseparable,
thus one always has to write
new Point(1, 2),
and writing just
Point(1, 2) is a mistake.
String and array literals also represent objects.
They are allocated implicitly,
without specifying a constructor name or the
Similarly, autoboxing can allocate objects implicitly,
+ operator with at least one
will allocate a new