Q:

Declare two dimensional array called Array1 that consists of three rows and four columns as following

0

Exercise 8: Declare two dimensional array called Array1 that consists of three rows and four columns as following:

int[][] Array1 = {{2, 5, 1, 6}, {3, 3, 3, 6}, {1, 5, 11, 98}}

Print the element in the second row and third column.

Print all array elements using the nested for loops.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import java.util.Scanner;
public class HelloWorld
{
	public static void main(String[] args) {
	    int[][] Array1 = {{2, 5, 1, 6}, {3, 3, 3, 6}, {1, 5, 11, 98}};
	    System.out.println(Array1[1][2]);
	    for(int row=0 ;row<Array1.length;row++)
	    {
	        for(int column=0;column<Array1[row].length;column++)
	        {
	            System.out.print(Array1[row][column]+"  ");
	        }
	        System.out.println("");
	    }
    
	    
	}
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now