Java StringReader.read()
Syntax
StringReader.read() has the following syntax.
public int read() throws IOException
Example
In the following code shows how to use StringReader.read() method.
/*w ww. ja va2 s. c o m*/
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");
System.out.println(stringReader.read());
stringReader.close();
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.io »
Java Tutorial »
java.io »