I have following java code, which accepts 10 string input. i need to accept only the unique input . By this i mean to say that if 1st device address is "123" and 2nd device address is also "123" then it should display an error.
This is the sample code and i have shorten it.
InputStreamReader istream = new InputStreamReader(System.in) ;
BufferedReader bufRead = new BufferedReader(istream) ;
for (int i=0; i<10; i++)
{
try {
System.out.println("Device Address: ");
String DevAdd = bufRead.readLine();
System.out.println("Device address:" + DevAdd);
}
catch (IOException err) {
System.out.println("Error reading line");
}
catch(NumberFormatException err) {
System.out.println("Error Converting Number");
}
}