PPT Slide
Constructors CANNOT have return values:
Do NOT do this:
public int Person ( )
{
. . . // whatever code
} // of constructor
public void Person ( )
{
. . . // whatever code
} // of constructor
Java Constructors
A return value (including void) means that the method is NOT a constructor, and it won’t be auto-invoked.
Previous slide
Next slide
Back to first slide
View graphic version