wood burning stoves
The moose likes Beginning Java and the fly likes printing an 2d array by row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "printing an 2d array by row" Watch "printing an 2d array by row" New topic

printing an 2d array by row

Ryan Perlman

Joined: Oct 31, 2001
Posts: 23
I thougth I was doing it right but with my output it is not I know I am making just one little mistake. please point me to the right spot..
here the code:

Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Ryan,
Common programming mistake. Get used to using braces for loops because it is the safest approach.
Your loop (compiler supplied braces):

What you really want:

Little things mean a lot,
I agree. Here's the link: http://aspose.com/file-tools
subject: printing an 2d array by row
It's not a secret anymore!