Skip to content

Instantly share code, notes, and snippets.

@rahulmalhotra
Created November 26, 2017 03:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rahulmalhotra/a444d7a1a5df39c1280778f63440800a to your computer and use it in GitHub Desktop.
Java program to create 2-D array using new keyword.
public class array {
public static void main(String[] args) {
int m[][]=new int[2][2];
for(int i = 0;i<2;i++)
{
for(int j=0;j<2;j++)
{
m[i][j]=i+j+1;
System.out.println(m[i][j]);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment