Specifications

Sun Services
Java™ Programming Language
Module 3, slide 21 of 37
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Constructing and Initializing Objects
Calling new
Xyz
() performs the following actions:
a. Memory is allocated for the object.
b. Explicit attribute initialization is performed.
c. A constructor is executed.
d. The object reference is returned by the new
operator.
The reference to the object is assigned to a variable.
An example is:
MyDate my_birth = new MyDate(22, 7, 1964);