Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
java - parseInt
Name: cesar_NZ Date: October 28, 2008 at 15:43:52 Pacific OS: solaris CPU/Ram: na Product: na
Comment:
hi all, am doing something really simple (at least looks simple to me) but i get a java.lang.NumberFormatException: For input string: "70611111111111111111111111111111111111"
all my code does it try and parse a string, does this error mean the integer value of the string passed in is too big ?? what other way can i use to convert it back to int ?
If I'm correct, I think Java ints can go as high as (2^31)-1. As a side note as well, I think you can omit the "java.lang." in your code. From what I've seen java.lang is a default package and is automatically imported by most compilers.
0
Response Number 2
Name: klint Date: October 30, 2008 at 06:48:06 Pacific
Reply:
Are you really going to use such a big number as an integer? What is the purpose? Perhaps the java.math.BigInteger class can help.
Summary: import javax.swing.JOptionPane; import java.util.Random; class random2 { public static void main(String[] args) { final int grense = 6; Random randomGen = new Random(); String antallLest ...
Summary: Ok, Im working on a program which needs to read a text file like so : 0000000000 0011110000 0011110000 0010010000 0000000000 0100001000 0010010000 0001100000 0000000000 0000000000 and put the numbers...
Summary: It's tough to know what you're trying to do here, but it looks like you're "encrypting" a string by replacing characters with their ascii equivalent. So I guess you want to decrypt from the ascii num...