List of usage examples for java.util Scanner toString
public String toString()
Returns the string representation of this Scanner .
From source file:Main.java
public static void main(String[] args) { String s = "java2s.com 1 + 1 = 2.0 true "; Scanner scanner = new Scanner(s); System.out.println(scanner.nextLine()); System.out.println("" + scanner.toString()); scanner.close();// w ww . j a v a2s . c om }