Java Long toString() method example

HQ ┬╗ Java Tutorial ┬╗ java.lang ┬╗ Long ┬╗ toString()
Java Long toString() method example 2018-02-16T07:26:10+00:00

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

Contact Info


Our Goal

JavaTutorialHQ aims to to be The Ultimate Guide on Java with hundreds of examples from basic to advance Topics.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.