Class: Instantiating a Class

Instantiating a Class

Point originOne = new Point(23, 94);
  • The new operator instantiates a class by allocating memory for a new object and returning a reference to that memory. The new operator also invokes the object constructor.
  • The new operator requires a single, postfix argument: a call to a constructor. The name of the constructor provides the name of the class to instantiate.
  • The new operator returns a reference to the object it created.

Related concepts

Instantiating a Class

Class: Instantiating a Class — Structure map

Clickable & Draggable!

Class: Instantiating a Class — Related pages: