int choice; System.out.println ("type 1 to add, 2 to display, 3 to delete, 4 to exit"); choice=input.nextInt(); while(choice!=4) { if(choice==2) rfile.displayAll(); if(choice==3) rfile.deleteRecord(); System.out.println ("type 1 to add, 2 to display, 3 to delete, 5 to exit"); choice=input.nextInt();
I keep getting run time erroe when I select option 3 and use the while loop
but if i call the delete method directly its fine
Why is that?