Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.help Subject: Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Date: Fri, 01 Jul 2011 18:19:14 -0700 Organization: A noiseless patient Spider Lines: 31 Message-ID: References: <521s0711i3d7bsc8620isi0oiidl91kujq@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 2 Jul 2011 01:19:16 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="5HSAJfqnDjjLFxXZ6WBWEw"; logging-data="29193"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Mbp/gygl0GLXhAP1mkU899st4GrY5tRI=" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 In-Reply-To: <521s0711i3d7bsc8620isi0oiidl91kujq@4ax.com> Cancel-Lock: sha1:/G3iGQn5qUMPTmWv5Hm7Tl9d2ko= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.help:804 On 7/1/2011 10:53 AM, Thee Chicago Wolf [MVP] wrote: > int oneBigInt=0; > String num = "450"; > oneBigInt = toInt(num); > How can I use it properly? There's no toInt method in the Java API that I'm aware of (and I do know a far percentage of the Java API). > static int toInt(java.lang.String str, int defaultValue) > NumberUtils.toInt() Ditto, these don't exist in the Java API. > Can someone kind soul give me some pointers? Ask an instructor, TA or classmate what API you are supposed to be using. Then get the docs for that API. I could speculate, but I don't want to give you a bum steer either. If I had to guess, being an assignment, you aren't supposed to be using these and should stick to the standard API. > - Thee Chicago Wolf [MVP] ^^^^ Just curious if this is a typo or not.