class TestStringBuffer {

    public static void main(String[] args) {
        /* StringBuffer objects are NOT implicitly created
           the following will NOT work
         */
        // StringBuffer sb = "Hello";       
        // StringBuffer sb = { "Hello" };
            
        StringBuffer sb = new StringBuffer("Hello");
        sb.append(" World!");
        System.out.println(sb.toString() );    
        
        sb = addDate(sb);
        System.out.println(sb.toString() );
    }
    
    public static StringBuffer addDate(StringBuffer buf) {
        /* Inserts the current date at the beginning
           of the buffer and returning the same buffer it
           was passed.
         */
        String now = new java.util.Date().toString();
        buf.insert(0,now).insert(now.length(),": ");
        return buf;
    }
}