• Post Reply Bookmark Topic Watch Topic
  • New Topic

convert long or String to Number  RSS feed

 
Fernando Dominguez
Ranch Hand
Posts: 108
Debian Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

Is there any way to convert a long or String to Number

Thanks.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Number is an abstract class so you can't convert anything to one.
You could have a Number reference variable refer to a Long object which you create from a long.And as long as the String has an appropriate value, many of Number's subclasses have relevant parsing methods.
Is that what you meant ?
[ December 07, 2007: Message edited by: Joanne Neal ]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!