java.lang.Long toString()


The Long.toString() java method returns a String object representing this Long’s value. The value is converted to signed decimal representation and returned as a string, exactly as if the long value were given as an argument to the toString(long) method.

Method Syntax

public static int toString()

Method Argument

Data Type Parameter Description

Method Returns

The toString() method of Long class returns a string representation of the value of this object in base 10.


Requires Java 1.0 and up

Java Long toString() Example

Below is a simple java example on the usage of toString() method of Long class.

Sample Output

Below is the sample output when you run the above example.

Java Long toString() example output

Suggested Reading List