Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19099

Re: locals es loco?

From Eric Sosman <esosman@ieee-dot-org.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: locals es loco?
Date 2012-10-04 11:45 -0400
Organization A noiseless patient Spider
Message-ID <k4kau4$b01$1@dont-email.me> (permalink)
References <4b5511c5-799d-4469-9502-cdc39491234b@googlegroups.com>

Show all headers | View raw


On 10/4/2012 10:50 AM, bob smith wrote:
> I'm trying to come up with a mnemonic that helps me remember which variables get auto-initialized in Java.  Is it just locals that you have to explicitly initialize?

     Fields (both instance fields and static fields) are always
initialized to zero/false/null as appropriate.

     Parameters of methods and constructors are always initialized
by the caller's argument expressions.

     The variable in a `catch' clause is initialized to refer to
whatever was thrown.

     Nothing else is initialized until and unless you initialize it.

-- 
Eric Sosman
esosman@ieee-dot-org.invalid

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

locals es loco? bob smith <bob@coolfone.comze.com> - 2012-10-04 07:50 -0700
  Re: locals es loco? markspace <-@.> - 2012-10-04 08:09 -0700
  Re: locals es loco? Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-10-04 11:45 -0400
    Re: locals es loco? Lew <lewbloch@gmail.com> - 2012-10-04 12:01 -0700
  Re: locals es loco? Roedy Green <see_website@mindprod.com.invalid> - 2012-10-05 00:06 -0700
    Re: locals es loco? Lew <lewbloch@gmail.com> - 2012-10-05 10:55 -0700
      Re: locals es loco? Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-10-05 19:01 +0000
        Re: locals es loco? Lew <lewbloch@gmail.com> - 2012-10-05 12:41 -0700
      Re: locals es loco? Roedy Green <see_website@mindprod.com.invalid> - 2012-10-05 15:38 -0700

csiph-web