Java tutorial
import java.io.*; public class Main { public static void main(String[] args) { char[] c1 = { 'h', 'e', 'l', 'l', 'o' }; char[] c2 = { 'w', 'o', 'r', 'l', 'd' }; Writer writer = new PrintWriter(System.out); try { // write a char array writer.write(c1); // flush the writer writer.flush(); // write a new char array writer.write(c2); // flush the stream again writer.close(); } catch (IOException ex) { ex.printStackTrace(); } } }