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


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

Re: Array initialization

From Marcel Mueller <news.5.maazl@spamgourmet.org>
Newsgroups comp.lang.java.programmer
Subject Re: Array initialization
Date 2015-07-30 01:07 +0200
Organization MB-NET.NET for Open-News-Network e.V.
Message-ID <mpbmb0$snf$3@gwaiyur.mb-net.net> (permalink)
References <Array-20150729080212@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 29.07.15 08.06, Stefan Ram wrote:
>    Recently, being away from the keyboard, I wondered whether
>    the following was legal in Java:
>
> public final class Main
> { public static void main( final java.lang.String[] args )
>    { int a[] ={ 0, a[ 0 ] + 1, a[ 1 ]+ 1 };

Check for the operator precedence and the execution order and it is obvious.
The operator = is the last one executed. At this point the array already 
exists.

Marcel

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


Thread

Re: Array initialization Marcel Mueller <news.5.maazl@spamgourmet.org> - 2015-07-30 01:07 +0200
  Re: Array initialization Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-07-30 05:10 +0000

csiph-web