title: How to capture enter key, using scanner as console input?
body: <p>I want to capture enter character in console. I am inputting 2 strings. </p>
  
  <p>Case 1. removestudent(pressing enter) removes all the students from array list. </p>
  
  <p>Case 2. removestudent student1 removes students1 from array list.</p>
  
  <pre><code>Scanner in=new Scanner();
  
  type_op=in.next();
  
  param=in.next();
  
  if (type_op.equals("removestudent"))
  {
  
      //Calling remove student function and passing param over here.
  
  }
  </code></pre>
  
  <p>Now the case 2 works fine. However, for Case 1, I want param value to be null when user presses enter. I will then pass param as a null value to my remove function and delete all the students in the array list. </p>
  
  <pre><code>list1.clear();
  </code></pre>
  
  <p>Please help me in knowing how to get this enter key. </p>