I have this practice Java code that I'm trying to finish.
The obvious problem is that when I try to print the array[1][2], it returns null, so I'm thinking the array might be empty. How do I take the user input to put in the array?
import java.util.Scanner;
public class Studyone {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int row = 13;
int col = 25;
String sentence;
String sentence2;
String [][] map = new String[row][col];
for (int i = 0; i < map.length; i++)
{
for (int j = 0;i < map.length; i++)
{
System.out.println("Enter the element");
sentence2 = input.nextLine();
map[i][j]=sentence2;
if (row>col)
{
break;
}
}
}
System.out.println(map[1][2]);
}
}
