Organizational Research By

Surprising Reserch Topic

Java – Writer to String conversion

package com.beginnersbook.string;

public class WriterToString {
    public static void main(String args[]){
        // create a new writer
          StringWriter sw = new StringWriter();

          // append a char       
          sw.append(" xyz");
          String str = sw.toString();

abc xyz

asked Jun 11, 2015 in Java Interview Questions by rajesh
0 votes

Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.