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) |
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);
}
}
}
OutputWelcome to India.
Refer:https://docs.oracle.com/javase/8/docs/api/index.html?java/io/CharArrayWriter.html
No comments:
Post a Comment