Mega Code Archive

 
Categories / Java Tutorial / Development
 

Appending Basic Types

public class MainClass {   public static void main(String[] arg) {     StringBuffer buf = new StringBuffer("The number is ");     long number = 999;     buf.append(number);     buf.append(12.34);     System.out.println(buf);   } } The number is 99912.34