• Post Reply Bookmark Topic Watch Topic
  • New Topic

long to java.lang.Long  RSS feed

 
Mahesh Malviya
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
Can any body tell me how will I convert a long primitive data type into java.lang.Long.
I have a variable of type long say lamount. I want to convert it to Long.
Any suggestion.

Thanks and Regards
Mahesh Malviya
 
Greg T Robertson
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should look at the constructors for java.lang.Long
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mahesh,

Example:


You can refer to Long API for more info.

Joyce
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that with autoboxing added in Java 2 v5, the conversion can be done by the compiler.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!