A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Software Craftsman
this week in the
Cast a String to a long?
Joined: Jun 27, 2002
Nov 06, 2002 08:57:00
Is it possible to cast a
to a long? I first looked for String methods that would allow me to do this, and then I tried doing this:
long foo = (long) blah;
That gives me an 'inconvertible types' error.
Joined: May 10, 2001
Nov 06, 2002 09:04:00
Check out the parseLong() method in the Long class. It takes a String arguemnt and returns a long (primitive).
I agree. Here's the link:
subject: Cast a String to a long?
Re: comparision of long with Integer
To Cast or Not To Cast
POI Converting Long Number to Sciebtific Notarion
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015