Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #806
| Date | 2011-07-01 20:28 -0700 |
|---|---|
| From | Patricia Shanahan <pats@acm.org> |
| Newsgroups | comp.lang.java.help |
| Subject | Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? |
| References | <521s0711i3d7bsc8620isi0oiidl91kujq@4ax.com> <ium20j$rg8$1@dont-email.me> |
| Message-ID | <IIidnWV4RpbIDZPTnZ2dnUVZ_rmdnZ2d@earthlink.com> (permalink) |
On 7/1/2011 8:06 PM, Eric Sosman wrote: > On 7/1/2011 1:53 PM, Thee Chicago Wolf [MVP] wrote: >> >> Doing homework for a programming course and we're given a 1000 digit >> String which we have to convert to integer, load into an array, and >> then find the largest product of a group of 5 integers. I know I can >> use the Integer.parseInt( ) method [...] > > You'd better hope that most of those digits are zeroes... > > It seems likely that the homework assignment is intended to make > you think about other ways than `int' or even `long' for representing > integers. Representations that can handle this sort of count-all-the- > protons-in-the-universe-if-every-actual-proton-were-a-universe-itself > kind of magnitude. Java provides at least two such things; I think > you're being encouraged to discover and use one or both of them. > >> but I wanted to play around with >> the toInt() method. From what I can gather, it's essentially the same >> thing...basically the opposite to the toString() method. So, I've >> tried a few things and I can't get it to work the way I want. ... > Check with whoever provided the NumberUtils class. It doesn't > come with Java; somebody else must have written it. > org.apache.commons.lang.math.NumberUtils does have a toInt method, but it is not particularly useful for this problem, because it returns an int. Patricia
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar
Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-01 12:53 -0500
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Jeff Higgins <jeff@invalid.invalid> - 2011-07-01 17:55 -0400
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-01 18:19 -0700
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 10:26 -0500
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-05 13:39 -0400
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 13:57 -0500
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-05 13:01 -0700
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 15:47 -0500
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-05 14:57 -0700
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-06 13:11 -0500
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-06 11:54 -0700
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-06 16:58 -0500
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-06 15:36 -0700
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Patricia Shanahan <pats@acm.org> - 2011-07-06 16:53 -0700
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-06 18:07 -0700
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-07-06 09:57 +0100
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-06 13:13 -0500
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-07-07 09:43 +0100
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Lothar Kimmeringer <news200709@kimmeringer.de> - 2011-07-06 11:15 +0200
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-06 13:14 -0500
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-05 16:27 -0400
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Lothar Kimmeringer <news200709@kimmeringer.de> - 2011-07-06 11:22 +0200
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-06 07:33 -0400
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-01 23:06 -0400
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Patricia Shanahan <pats@acm.org> - 2011-07-01 20:28 -0700
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 10:27 -0500
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Roedy Green <see_website@mindprod.com.invalid> - 2011-07-04 08:59 -0700
Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 10:30 -0500
csiph-web