[2785] in java-interest
Re: variable initialization...
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Fri Oct 13 14:54:21 1995
Date: Fri, 13 Oct 1995 09:31:48 -0700
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: pat@icon-stl.net
Cc: java-interest@java.Eng.Sun.COM
Hi Pat,
> So, uninitialized instance variables are set to zero or null.
> Uninitialized local variables are invalid.
> Except for the elements in arrays which are always initialized to zero or
null.
>
> Could someone explain the rationale for the distinction?
> Is it related to optomization?
It is a common programming error to forget initialization of a local
variable. We decided that silently initializing it would be more harmful
then helpful.
Have fun,
Arthur van Hoff
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com