Join
Blogs
Questions
Videos
Tags
Members
Search
 
 
Create your own blog, earn points and get popular!

Convert Long to String example

  1. /*
  2.  * Convert Long to String example. Program to convert Java
  3.  * Long object to String object.
  4.  */
  5.  
  6. public class LongToString {
  7.  
  8.  public static void main(String args[]){
  9.  
  10.   //new Long object
  11.   Long lObj = new Long("1233243449");
  12.  
  13.   //to convert Long to String use toString method of Long wrapper class
  14.   String strLValue = lObj.toString();
  15.  
  16.   System.out.println("Long converted to String: " + strLValue);
  17.  
  18.  }
  19.  
  20. }
Your rating: None Average: 5 (1 vote)
Share this
Anonymous's picture

is there any way I can

is there any way I can convert long primitive to String?

Post new comment

14 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.