Share on Google+Share on Google+

java.lang.String.valueOf(long lnum)

Advertisement
The given example will discuss about valueOf(long lnum) method of Java String class.

The given example will discuss about valueOf(long lnum) method of Java String class.

According to Java's Primitive Data Types long is ...

8 bytes signed (two's complement). That ranges from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807.

In this example we are going to display the min range of long in Java using valueOf(long lnum) method.

a simple example:

public static void main(String[] args)
{
String minimumStr = String.valueOf(Long.MIN_VALUE);

// long values.
System.out.println(minimumStr );
}

the output is:

-9223372036854775808

Advertisements

Posted on: March 22, 2005 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: java.lang.String.valueOf(long lnum)  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0