----------------------------------- Homer_simpson Fri Feb 13, 2004 1:52 pm how do i parse in a double? ----------------------------------- how do i parse in a double? ----------------------------------- wtd Fri Feb 13, 2004 5:36 pm ----------------------------------- See my post in this thread. http://www.compsci.ca/v2/viewtopic.php?t=3632 ----------------------------------- Homer_simpson Fri Feb 13, 2004 8:16 pm ----------------------------------- well if u'd looked at that post closely u'd see that i've got 2 posts in there... and it doesn't work... but thx for response... but anyway i figured how to do it... u can just use Double.valueOf to parse it in... :D ----------------------------------- Dan Fri Feb 13, 2004 10:28 pm ----------------------------------- thats odd, Double.parseDouble(String) works for me, same with it's int equivlent. are u using an unstandered java lib or somting? ----------------------------------- Homer_simpson Fri Feb 13, 2004 11:28 pm ----------------------------------- yes but there's a difference between Double and double... ----------------------------------- Paul Fri Feb 13, 2004 11:32 pm ----------------------------------- thats odd, Double.parseDouble(String) works for me, same with it's int equivlent. are u using an unstandered java lib or somting? Thats always what I used too, I just didn't wanna post, cause i wasn't sure, since Homer already posted this on the other help thread, so I thought if he knew about it... Oh and I thought double was just a kind of a variable that can have decimals, you know... when you declare it its double, but when you use it in that line its Double, just like parsInt. Im not sure though. ----------------------------------- wtd Fri Feb 13, 2004 11:59 pm ----------------------------------- In Java not everything is an object. Most things are, but there are also some basic types: char - not like char in C-based languages, where char is one byte. In jaa char is 2 bytes (to accomodate unicode). short - 6 bit integer. int - 32 bit integer. long - 64 bit integer float - single precision (32-bit) floating point number double - double precision (64-bit) floating point number These are passed by value, rather than by reference, a behavior that's quite often expected to be correct. The problem is that there are lots of places in Java that only objects can go, so most of those types, including double, are also classes, though in Java-style, the class name begins with a capital letter. Since Java doesn't support operator overloading (except in the String class, and you'll have to talk to Sun about that one), you can't have code like: Double d = new Double(4.2); d = d - 2.5; Though I don't know how this holds up now that Java 1.5 features auto-boxing. I hope that helped you understand the difference between "Double" and "double". ----------------------------------- Homer_simpson Sat Feb 14, 2004 2:30 am ----------------------------------- yes and Double isn't just a variable type... it's a full class with a lotta constructors... veryuseful...