jamesonh20 12 Junior Poster in Training

Hello I am trying to underline -->

1 5 6 only the 1
2 2 2 only the middle 2
1 6 4 only the 4

I have imported the java.awt.* but im not sure how to write the code, the java api is a little confusing.

import java.awt.*;
public class Arry2
{
   public static void main(String[] args)
   {
       int row, col;
       int[][] a = {{1,5,6},{2,2,2},{1,6,4}};
        for (row = 0; row < 3; row++)
        {
            for (col = 0; col < 3; col++)
            {                
                System.out.print(a[row][col]+" ");
               
            }
            System.out.println();
        }
    }
}

Thanks
Jamesonh20'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.