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[] argsthrows 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

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US