2D Array in Java Simple Program
// 2D array Program numbers in table form.
//Java 2D Array
package assignment6;
public class Assignment6 {
public static void main(String[] args) {
int array[][]={{2,4,6,8,10},{3,5,7,9,11},{4,6,8,10,12},{5,7,9,11,13}};
for(int r=0; r<4; r++)
{
for(int c=0; c<5; c++)
{
System.out.print(array[r][c]+"\t");
}
System.out.println();
}
}
}
//Java 2D Array
package assignment6;
public class Assignment6 {
public static void main(String[] args) {
int array[][]={{2,4,6,8,10},{3,5,7,9,11},{4,6,8,10,12},{5,7,9,11,13}};
for(int r=0; r<4; r++)
{
for(int c=0; c<5; c++)
{
System.out.print(array[r][c]+"\t");
}
System.out.println();
}
}
}
Output
2D array in Java programming output.