Java StringReader.skip(long ns)

Syntax

StringReader.skip(long ns) has the following syntax.

public long skip(long ns)  throws IOException

Example

In the following code shows how to use StringReader.skip(long ns) method.


/*w  w w .j av  a 2s  . c  om*/
import java.io.IOException;
import java.io.StringReader;

public class Main {
  public static void main(String[] argv) throws IOException{
    StringReader stringReader = new StringReader("java2s.com");
    stringReader.skip(2);
    System.out.println(stringReader.read());
    
    stringReader.close();
  }
}

The code above generates the following result.