wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "printing an 2d array by row" Watch "printing an 2d array by row" New topic
Author

printing an 2d array by row

Ryan Perlman
Greenhorn

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,
Manfred.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: printing an 2d array by row
 
Similar Threads
Editable cells in a JTable
Changing an arrays size
Writing to a File
Can't resolve compiler error message
Reading Objects and Formatting Ouput