Initializing and using class variables

Stephane Ducasse ducasse at iam.unibe.ch
Mon Jan 20 11:28:28 UTC 2003


usually you initialize classVariable in the initialize of the class 
(class method initialize) which is invoked once when the class is 
loaded (at the end of the load). You can also use lazy initialization.


Stef
On Monday, January 20, 2003, at 12:21 PM, Ralf Bokelberg wrote:

> How can i initialize and use class variables ?
> Is initialize ever executed by the class ?
>
> ------------------
> initialize
>  "Initialize the class variables"
>
>  Transcript show: 'Initializing class WorldBouncer '; cr.
>  CoeffDrag _ 0.03.
>  Gravity _ 9.81.
>
>  "WorldBouncer initialize."
>
> ------------------
> initialize
>  "Initialize the instance"
>
>  Transcript show: 'Initializing instance of WorldBouncer. Gravity: '; 
> show:
> Gravity; cr.
>  "Why Gravity is nil ?"
>
> kind regards
> bokel
>
>
>
>
Prof. Dr. Stéphane DUCASSE (ducasse at iam.unibe.ch) 
http://www.iam.unibe.ch/~ducasse/
  "if you knew today was your last day on earth, what would you do
  different? ... especially if, by doing something different, today
  might not be your last day on earth" Calvin&Hobbes




More information about the Squeak-dev mailing list