Navigation:  Appendix A: Jumping Into Smalltalk >

Constructors

Previous pageReturn to chapter overviewNext page

Smalltalk has no constructors. If you want to perform instance initialization, you can redefine the "new" class method to initialize the instance.

Java

Smalltalk

Reservation()
{
startTime =
new GregorianCalendar().getTime();
endTime =
new GregorianCalendar().getTime();
}

Reservation class method:
new
^super new initialize
 
Reservation instance method:
initialize
startTime := Timestamp now.
endTime := Timestamp now