Java Data Type Tutorial - Java StringBuilder.append(long lng)








Syntax

StringBuilder.append(long lng) has the following syntax.

public StringBuilder append(long lng)

Example

In the following code shows how to use StringBuilder.append(long lng) method.

/*from   w  w  w . ja  va2  s  . c  om*/
public class Main {

  public static void main(String[] arg) {

    StringBuilder buffer = new StringBuilder();
    
    long l = 123456789098765L;
    buffer.append(l);
    
    System.out.println(buffer);
  }

}

The code above generates the following result.