Question

Write the java code for printing a two dimensional array. You may assume any number of...

Write the java code for printing a two dimensional array. You may assume any number of row and columns for this array. Just declare the array and write the code to print the elements row by row.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
//TestCode.java
public final class TestCode {
    public static void main(String[] args) {
        int myArray[][] = {{45,67,32},{67,17,39},{98,43,63}};
        for(int i = 0;i<myArray.length;i++){
            for(int j = 0;j<myArray[i].length;j++){
                System.out.print(myArray[i][j]+" ");
            }
            System.out.println();
        }
    }
}

Add a comment
Know the answer?
Add Answer to:
Write the java code for printing a two dimensional array. You may assume any number of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT