searching for a name in my 2d array and printing the info that is on its row
I am trying to input the name and phone number of a person in the 2d array, then enter that same name and have the system search the array for the name and print out the name and number. I don't know what is wrong. Thanks for the help.
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class phone {
public static void main(String arg[])throws java.io.IOException {
InputStreamReader istream = new InputStreamReader(System.in);
BufferedReader read = new BufferedReader(istream);
{
String numbers[][] = new String[3][2];
int i;
System.out.println("Enter new name: ");
String r = read.readLine();
for(i= 0; i < numbers.length; i++)
r = numbers[i][0];
System.out.println("Enter new number: ");
String s = read.readLine();
for(i= 0; i < numbers.length; i++)
s = numbers[i][1];
System.out.println("Enter name you are looking for: ");
String x = read.readLine();
for(i= 0; i < numbers.length; i++)
if(numbers[i][0].equals(x))
{
System.out.println(numbers[i][0] +" : "+numbers[i][1]);
}
}
}
}