I am creating a java application and I need to get the user PINs from the text file. I used the following code below, but is it not working properly. Could anyone please help me out soon.....
String typedPIN="";
Menus obj1=new Menus();
BufferedReader getIt=new BufferedReader(new InputStreamReader(System.in));
String userPIN="";
try{
BufferedReader br = new BufferedReader(new FileReader(new File("D:\\Studies\\BCAS\\HND\\Semester 1\\Programming Concepts\\Assignment\\AccountPIN.tab")));
String strLine=null ;
System.out.println("Enter PIN");
userPIN=getIt.readLine();
while ((strLine = br.readLine()) != null) {
if(userPIN.equals(strLine)){
System.out.println("You have login!");
obj1.MainMenu();
}
}
}catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());
}
}