Tuesday 20 September 2016

Java Tutorial : Java IO (StringReader)


Click here to watch in Youtube :
https://www.youtube.com/watch?v=IntmnUJ-4Pg&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Java Tutorial : Java IO (StringReader) 
Java Tutorial : Java IO (StringReader) 

StringReaderDemo.java
import java.io.StringReader;

public class StringReaderDemo
{

    public static void main(String[] args) throws Exception
    {
        StringReader stringReader = null;
        try
        {
            String str = "Hello";
            stringReader = new StringReader(str);

            int data;
            while ((data = stringReader.read()) != -1)
            {
                System.out.print((char) data);
            }

        }
        finally
        {
            if (stringReader != null)
            {
                stringReader.close();
            }
        }
    }
}
Output
Hello
Refer:
https://docs.oracle.com/javase/8/docs/api/index.html?java/io/StringReader.html
Click the below link to download the code:
https://sites.google.com/site/ramj2eev1/home/javabasics/JavaIODemo_StringReader_App.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/JavaIODemo_StringReader_App

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/301d989d72a8b053f20342cfe0bd4a5c143c23aa/BasicJava/JavaIODemo_StringReader_App/?at=master

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • No comments:

    Post a Comment