wood burning stoves*
The moose likes Beginning Java and the fly likes please explain the output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "please explain the output" Watch "please explain the output" New topic
Author

please explain the output

Jhon Clay
Greenhorn

Joined: Jul 16, 2007
Posts: 16



output



How can this be possible when the array values are diffrent
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

Chandan,

Review the way a foreach (advanced for loop) works for arrays, as opposed to standard for loops and I think you'll discover why you're getting the results you're seeing.


There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
jaspreet atwal
Ranch Hand

Joined: Sep 05, 2007
Posts: 52
Originally posted by chandan venkatesh:
[QB][QB]


You have made a mistake in println statement...


Still Learing..
Jhon Clay
Greenhorn

Joined: Jul 16, 2007
Posts: 16
Thanks mates
should have been
""""""""""""""""""""""""""""""""""""""
for(int z : x) System.out.println( z);
"""""""""""""""""""""""""""""""""""""""
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: please explain the output
 
Similar Threads
Qn on assertion.
local variable not assigned any value in a method yet how does it compile??
Assertion topic
How to turn on assert in TextPad ?
x++ , ++x