Sunday, 11 June 2017

Java Tutorial : Java IO (CharArrayWriter) ~ foundjava


Click here to watch in Youtube :

Click the below Image to Enlarge
Java Tutorial : Java IO (CharArrayWriter) 
Java Tutorial : Java IO (CharArrayWriter) 
Java Tutorial : Java IO (CharArrayWriter) 
CharArrayWriterDemo.java
import java.io.CharArrayWriter;
import java.io.IOException;

public class CharArrayWriterDemo
{

    public static void main(String[] args) throws IOException
    {
        CharArrayWriter charArrayWriter = new CharArrayWriter();

        charArrayWriter.write("Welcome to India.");

        /*
         * Returns: an array of chars copied from the input
         * data.
         */
        char[] charArray = charArrayWriter.toCharArray();

        for (char c : charArray)
        {
            System.out.print(c);
        }

    }
}
Output
Welcome to India.
Refer:
https://docs.oracle.com/javase/8/docs/api/index.html?java/io/CharArrayWriter.html
Click the below link to download the code:

CLICK HERE

No comments:

Post a Comment