15.2. Enhanced for loop for Arrays and Collections

35 views
Skip to first unread message

Timm Gutowski

unread,
Jun 11, 2013, 12:26:36 PM6/11/13
to vog...@googlegroups.com
This is not what you want:

for (int i : array) {
System.out.println("Element at index " + i + " :" + array[0]);
}

Lars Vogel

unread,
Jun 17, 2013, 5:07:00 AM6/17/13
to vog...@googlegroups.com
Thanks fixed.


2013/6/11 Timm Gutowski <timm.g...@gmail.com>
This is not what you want:

for (int i : array) {
      System.out.println("Element at index " + i + " :"  + array[0]);
}

--
You received this message because you are subscribed to the Google Groups "vogella" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vogella+u...@googlegroups.com.
To post to this group, send email to vog...@googlegroups.com.
Visit this group at http://groups.google.com/group/vogella.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages