Convert long to String in Java

With the help of String.valueOf() and Long.toString() methods, you can convert long to String in Java.

Example of Java long to String conversion

Following is the example that will show conversion from long to String-

public class Example
{
	public static void main(String args[])
	{
		long l = 11122334455L;
		String a = String.valueOf(l);		
		String b = Long.toString(l);
		System.out.println("a = "+a);
		System.out.println("b = "+b);
	}
}

Output

a = 11122334455
b = 11122334455