• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

please explain the output

 
Jhon Clay
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



output



How can this be possible when the array values are diffrent
 
Stevi Deter
Ranch Hand
Posts: 265
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
jaspreet atwal
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by chandan venkatesh:
[QB][QB]


You have made a mistake in println statement...
 
Jhon Clay
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks mates
should have been
""""""""""""""""""""""""""""""""""""""
for(int z : x) System.out.println( z);
"""""""""""""""""""""""""""""""""""""""
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic