#003 Object Detail
Point originOne = new Point(23, 94);
Rectangle rectOne = new Rectangle(originOne, 100, 200);
Rectangle rectTwo = new Rectangle(50, 100);
first line creates an object from the Point class and the second and third lines each create an object from the Rectangle class.
Declaration: The code set in bold are all variable declarations that associate a variable name with an object type.
Instantiation: The new keyword is a Java operator that creates the object. As discussed below, this is also known as instantiating a class.
Initialization: The new operator is followed by a call to a constructor. For example, Point(23, 94) is a call to Point's only constructor. The constructor initializes the new object.
The declared type matches the class of the object:
MyClass myObject = new MyClass();
...