Example usage for java.util Scanner toString

List of usage examples for java.util Scanner toString

Introduction

In this page you can find the example usage for java.util Scanner toString.

Prototype

public String toString() 

Source Link

Document

Returns the string representation of this Scanner .

Usage

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
}