Need help with Java programming?

Hi, I've been having some trouble with my program. Whenever I run it, the first string and numbers read in fine but then it does: // #2: Please type in four positive integers. // without letting me type in a string. Please help! I have the code below: public static void main(String[] args) { ... show more Hi, I've been having some trouble with my program. Whenever I run it, the first string and numbers read in fine but then it does:
//
#2:
Please type in four positive integers.
//
without letting me type in a string. Please help! I have the code below:

public static void main(String[] args)
{
String[] input = new String[5];
int[][] encode = new int[2][2];
Scanner doowy = new Scanner(System.in);
System.out.println("Please input five strings.");
for(int x = 0; x < 5; x++)
{
System.out.print("#" + (x+1) + ": ");
input[x] = doowy.nextLine();
input[x].replaceAll("\\s+","_");
System.out.println();
System.out.println("Please type in four positive integers.");
for(int y = 0; y < 2; y++)
for(int z = 0; z < 2; z++)
encode[y][z] = doowy.nextInt();
//toMatrix(input[x], encode); //Store string in matrix and go through encryption
System.out.println();
}
}
Thanks
Update: What would I need to change the code so that it works?
1 answer 1