I want to capture enter character in console. I am inputting 2 strings.
Case 1. removestudent(pressing enter) removes all the students from array list.
Cas
I think this will help you
Scanner input= new Scanner(System.in);
String readString = input.nextLine();
while(readString!=null) {
System.out.println(readString);
if (readString.equals(""))
System.out.println("Read Enter Key.");
if (input.hasNextLine())
readString = input.nextLine();
else
readString = null;
}