File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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:
subject: printing an 2d array by row
It's not a secret anymore!