0
I want to write java program with 2 dimensionl array
array of 3Ă3 that lists the letter grade of 3 students in 3 subject
8 Answers
+ 2
class DDArray
{
public static void main(String args[])
{
int x[3][3]={{1,2,3},{4,5,6},{7,8,9}};
System.out.println(âThe Matrixâ);
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
System.out.print(x[i][j] + â â);
System.out.println();
}
}
}
Execution
=======
javac DDArray.java
java DDArray
1 2 3
4 5 6
7 8 9
+ 1
Mr yaseer
So what is there issue and who is stopping you?
+ 1
Me didn't know anything about java
+ 1
Mr yaseer
You don't know anything about Java and directly started to write 2D array? Do you know 1D array?
+ 1
No
+ 1
Then you should first know about that.
+ 1
The Syntax like :
data_type[][] array_name = {
{valueInRow1Column1, valueInRow1Column2, ...},
{valueInRow2Column1, valueInRow2Column2, ...}};
Exp: int[][] arr = {{1, 2}, {3, 4}};
+ 1
Thanks you