Writer append() Example
Appends the specified character to this writer.
Writer class append() method example. This example shows you how to use append() method.This method Appends the specified character to this writer.
Here is the code:-
/**
* @Program that Appends the specified character to this writer.
* Append.java
* Author:-RoseIndia Team
* Date:-5-jun-2008
*/
import java.io.*;
public class Append {
public static void main(String[] args) throws IOException {
StringWriter w = new StringWriter();
w.write("Ros");
System.out.println("String before Appending is: " + w);
char c = 'e';
//Appends the specified character to this writer.
System.out.println("String after Appending is : " + w.append(c));
}
} |
Output of the Program
String before Appending is: Ros
String after Appending is : Rose |
|