Example usage for java.util Scanner remove

List of usage examples for java.util Scanner remove

Introduction

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

Prototype

public void remove() 

Source Link

Document

The remove operation is not supported by this implementation of Iterator .

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());

    // attempt to call remove results in an exception
    scanner.remove();

    scanner.close();/*from  w w w .  j  a v  a 2  s . co  m*/
}