public String readLine(){
  String line;
  try {
    line=scanner.nextLine();
  }
 catch (  NoSuchElementException e) {
    line=null;
  }
  return line;
}

public String readLine ( ) { String line ; try { line = scanner . nextLine ( ) ; } catch ( NoSuchElementException e ) { line = null ; } return line ; }
reads and returns the next line in this input stream .
