JDK 1.1.8 and Double.parseDouble

I've downloaded JDK 1.1.8 from this web site.
When I try to compile the program which includes converting input data into decimal number the compiler says that it can't find method parseDouble in the class java.lang.Double.
I know that the source code is right, because I've tried to compile and run this program on another computer. Java applications on that computer are installed from Jbuilder CD.
What's the problem with JDK 1.1.8?
Thanx for help

Depending on which version of JBuilder you have, it will install a JDK that is included with it.
For example, JBuilder 6 has JDK 1.3.1, which includes the parsing function you are looking for.
Why would you download 1.1.8 and not the latest version?
Thanks,
Haig

Similar Messages

  • Does browser support Double.parseDouble()???

    hi,
    i have used Double.parseDouble() method in my program. After i run that program in browser, it shows error "Double.parseDouble() method not found". Doesnt browser support Double.parseDouble()??? Can anybody tell me how to solve this error?? (i have also tried Float.parseFloat(),but same error occurs) Please help me.
    Thanks in advance,
    Kalpana.

    Newer non-Microsoft browsers such as Netscape 6 and Opera 5 support JDK 1.3. I think IE 5.1 for Mac OS X will use the JDK 1.3 installed on the computer, also. It's only older browsers and IE for Windows and Mac OS 9.1 and before that do not support JDK 1.3. Unfortunately, that's 90% of all browsers! :-(

  • Issue with Double.parseDouble

    ok i dono whats going on here im writing a console based bank management program and when converting a input srting from console.readline to Double.parseDouble it says the method parseDouble cannot be found, im using the latest jvm whats going on! help!

    my bad i ment latest jdk not thinking tonight! heres the error:
    D:\My Documents\Java\Bank Acount\AccountDriver.java:59: Method parseDouble(java.lang.String) not found in class java.lang.Double.
                             newAcc = Double.parseDouble (input);
                             ^
    1 error

  • Double.parseDouble(String) - problems when string is in scientific notation

    Hello guys,
    I'm doing some numerical calculations and I wonder whether it is possible for Double.parseDouble(String) to parse string in the scientific notation i.e. 1.0824234234E-10. Is it the notation itself causing the exception : NumberFormatException or the number is just too big/small and double can't hold it ?
    If it's just the notation how can I fix it ?
    Regards

    i'm not quite sure whether double odoes not allow it.
    perhaps consider the api Double.valueOf() and the testing code provided; reproduced below:To avoid calling this method on a invalid string and having a NumberFormatException be thrown, the regular expression below can be used to screen the input string:
            final String Digits     = "(\\p{Digit}+)";
      final String HexDigits  = "(\\p{XDigit}+)";
            // an exponent is 'e' or 'E' followed by an optionally
            // signed decimal integer.
            final String Exp        = "[eE][+-]?"+Digits;
            final String fpRegex    =
                ("[\\x00-\\x20]*"+  // Optional leading "whitespace"
                 "[+-]?(" + // Optional sign character
                 "NaN|" +           // "NaN" string
                 "Infinity|" +      // "Infinity" string
                 // A decimal floating-point string representing a finite positive
                 // number without a leading sign has at most five basic pieces:
                 // Digits . Digits ExponentPart FloatTypeSuffix
                 // Since this method allows integer-only strings as input
                 // in addition to strings of floating-point literals, the
                 // two sub-patterns below are simplifications of the grammar
                 // productions from the Java Language Specification, 2nd
                 // edition, section 3.10.2.
                 // Digits ._opt Digits_opt ExponentPart_opt FloatTypeSuffix_opt
                 "((("+Digits+"(\\.)?("+Digits+"?)("+Exp+")?)|"+
                 // . Digits ExponentPart_opt FloatTypeSuffix_opt
                 "(\\.("+Digits+")("+Exp+")?)|"+
           // Hexadecimal strings
           "((" +
            // 0[xX] HexDigits ._opt BinaryExponent FloatTypeSuffix_opt
            "(0[xX]" + HexDigits + "(\\.)?)|" +
            // 0[xX] HexDigits_opt . HexDigits BinaryExponent FloatTypeSuffix_opt
            "(0[xX]" + HexDigits + "?(\\.)" + HexDigits + ")" +
            ")[pP][+-]?" + Digits + "))" +
                 "[fFdD]?))" +
                 "[\\x00-\\x20]*");// Optional trailing "whitespace"
      if (Pattern.matches(fpRegex, myString))
                Double.valueOf(myString); // Will not throw NumberFormatException
            else {
                // Perform suitable alternative action
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Double.html

  • Double.parseDouble(String) : Problem to parse large String

    Hello,
    I need to convert A String to a Double in my application without rounding of digits.
    I have used the Double.parseDouble(String) method.
    The maximum string length can be 17 including dot(.)
    So if my String is (of length 17)
    Eg.
    S= �9999999999.999999� then I am getting the double value as
    d= 9999999999.999998(compare the last digit)
    If s = �9999999999.111111� then d = 9999999999.111110
    If s = �9999999999.555555� then d = 9999999999.555555 (result that I want)
    If s = �9999999999.666666� then d = 9999999999.666666 (result that I want)
    If s = �9999999999.777777� then d = 9999999999.777777 (result that I want)
    If s = �9999999999.888888� then d = 9999999999.888887
    If s = �9999999999.999999� then d = 9999999999.999998
    If s = �9123456789.123456� then d = 9123456789.123456
    But string length up to 16 is giving me the accurate result
    So any body can explain me that why it is happening? And how can i get the accurate result.
    Thanks in advanced.

    Hi,
    Thank You for your suggestion. By which i can store
    the big double number in Data base , but at some
    point i require to parse a double value from a Double
    reference.In that case if the Decimal value length
    => 16 then it the last digit changes or rounds.
    coverting 9999999999.999999 Decimal value to double
    value. It gives me 9999999999.999998 and
    9999999999.9999999 gives me the 10000000000.0000000.
    but the Double value 999999999.999999 is ok
    and 999999999.99999999 rounds.Err, is there a follow up question in there?

  • Double.parseDouble help?

    I have this String Number 20.000. When I do a parseDouble I get 20.0 which is right.
    public class qwerty {
         public static void main(String[] args) {
              String num = "20.000";
              System.out.println(Double.parseDouble(num));
    But is there a way to preserve the zeroes and it prints 20.000 itself after parse Double?

    But is there a way to preserve the zeroes and it prints 20.000 itself after parse Double?Not directly. Doubles (and doubles, and all other Number subclasses and number primitives) store only information about the value of the number, not how it is to be displayed.
    As mentioned, you'll need to use formatting provided either by a DecimalFormat object or a printf() function. To do what you're asking, you'd need to somehow parse the input string to determine the required format, and store that information separately (e.g. in a String or a DecimalFormat object), then use that whenever you want to display the number. Check out the documentation for DecimalFormat and PrintStream.printf().
    Regex would probably be helpful if you decide to go that route.

  • Double.parseDouble

    the user enters a premium amount and then I want to use that amount in a calcuation; can't I parseDouble it like this? apparently not, because when I try to multiply, I get an error "the operator * is undefined for argument type(s) double, String. I have done this in the past, what is wrong?
    String pAmount = JOptionPane.showInputDialog("Enter the premium amount:");
    double num = EndCancelDiffCounter;
                   double denom = counter;
                   double result = num/denom;
                   Double.parseDouble(pAmount);
                   double refund = result * pAmount;

    parseDouble returns a double, it does not change the
    String given froma String to a double. You need to
    store that result (return value) in a new double
    variable and perform your calculation with that.
    Edit: Man I'm slow. (I had to check that
    parseDouble returned a double and not a Double. I
    wasn't 100% sure, as I'm a little daft this morning.)I see, thank you

  • Double.parseDouble() is not Locale specific, how do I get round this?

    I am parsing Strings into doubles using
    String myNumber = "12,34";
    double d = Double.parseDouble( myNumber );The problem is that my number is of French style (it has commas instead of fullstops for the decimal points)
    The default Locale is English, so I get NumberFormat problems when parsing. (I can understand this)
    I even get NumberFormat problems when I do this:
    Locale.setDefault(Locale.FRENCH);
    double d = Double.parseDouble( myNumber );Which I think is really strange. I guess the Locale of Double is set at a certain time and not reset.
    OR maybe Double.parseDouble( <STRING> ); is not Locale specific?
    Where is my understanding wrong?

    Do you know if DecimalFormat reflects the default Locale if the default Locale changes?
    Or will I have to make a new DecimalFormat whenever it changes?As Locale is invariant, a DecimalFormat instance (as well a any object with a reference to the default Locale) cannot reflect the default Locale changes.
    But each time you create a new instance of DecimalFormat without specifying the Locale, it will get up-to-date Locale.
    However, you might prefer setting the locale explicitely (instead of changing the default one.)
    Note that Double valueOf() or parseDouble() methods are not related to default Locale, they use a fixed format.

  • What if Textfield t1 is blank?? num1=Double.parseDouble(t1.getText());

    Hi there
    Im coding a simple calculator with 2 Textfield for entering two numbers. If one of Textfields is blank and an operation button (+,-,*,/) is clciked, I want the 3rd Textfield t3 to read "ERROR".
    From the code below, what is num1 if t1 is blank. Or could you tell me how to go about this if statement.
    if (ae.getSource()==multi){
                   num1=Double.parseDouble(t1.getText());
                   num2=Double.parseDouble(t2.getText());
                   res=num1*num2;
                   t3.setText(""+res);
    cheers
    SERGIO

    I look forward to you figuring this out yourself.
    1. What does getText() return when then JTextField is empty?
    2. What happens when you pass that to parseDouble?
    3. Should you even bother passing that to parseDouble?

  • Double.parseDouble lost of precision!

    Hello,
    I have a small problem regarding convertion from string to double.
    double dTotal;
    dTotal = Double.parseDouble("10.01") + Double.parseDouble("0.12");
    Can someone explain me why my result is dTotal = 10.12999999999999 ?
    Thanks in advance.
    Remi.

    and read
    http://docs.sun.com/source/806-3568/ncg_goldberg.html
    This, too:http://java.sun.com/developer/JDCTechTips/2003/tt0204.html#2

  • Variants of Double.parseDouble

    I have an applet that runs perfectly on appletviewer but screws up when viewed through my web browser. It doesn't parse the string( number ) found in my textfield( input ). I did it like this: "x = Double.parseDouble( input.getText() );". what is the syntax that i should follow to conform with those that my browser could support? Probably an older one. My browser is IE 4 or 5... Thanks!

    Sun must have been struggling for a bit 'cos it wasn't until JDK1.2 that they introduced Double.parseDouble, even though Integer.parseInt has been there since the dawn of time itself.
    And since Microsoft stopped supported Java around JDK1.1.6 you'll probably find that your Applet is complaining that there's no such method (have a look in the Java Console in IE to see what it's got to say for itself).
    There are various things you could do:
    1) install the Java Plug-in to bring your JVM into this century
    2) see if DecimalFormat is supported by your runtime (can't find when it was introduced in the Javadocs - sorry)
    3) write your own simple double-parsing routine
    Personally I'd opt for 1. I'd be tempted to do option 2 as well but it's hardly necessary!
    Hope this helps.

  • Double.parseDouble returning 2.0E7

    Hi,
    I have a piece of code (snippet below)
    double aggrAmount=0.0;
    Tag t;
    aggrAmount=Double.parseDouble(t.getValue().substring(t.getValue().lastIndexOf("/")+1, t.getValue().length()-1));
    where t="AGGR//FAMT/20000000,"
    when i check aggrAmount the value is 2.0E7. How can i get the value as it is?
    PLs help...
    THanks for your time and advice

    when i check aggrAmount the value is 2.0E7. How can i get the value as it is?There's some confusion here between the value (a double value of twenty million), and the String you use to check it ("2.0E7"). They are different things.
    If you want to see or use the value in a string without the exponent business, use String.format() or DecimalFormat. Note that the value remains what it is (twenty million); numbers don't have a format.
    If you want the last part "as it is" ie as a String use String's lastIndexOf() and substring() methods and make value a String.

  • Float and Double - 5.1 divide by 3.0

    Hi everyone,
    I am quite new to java programming in term of using it. I wrote a test class to learn about float and double. However when I wrote the below code, I got a strange result. So, I wonder if java's float and double have any kind of exception I should be aware of. This won't happen if I just change from 3 to other numbers. Any suggestion? Thanks in advance.
    public class MathTest {
    public static void main (String args[]) {
    float f1 = 5.1F;
    float f2 = 3.0F;
    double d1 = 5.1;
    double d2 = 3.0;
    System.out.println("Float result : " + f1/f2);
    System.out.println("Double result : " + d1/d2);
    Result:
    Float result : 1.6999999
    Double result : 1.7

    This is due to the way that binary numbers convert to digital numbers and is expected. See these threads for explanations:
    http://onesearch.sun.com/search/onesearch/index.jsp?qt=%2Bprecision+%2Bwrong+double&col=developer-forums&rf=0&chooseCat=allJava&subCat=siteid%3Ajava

  • With Mavericks I have to hold command key down and double click to get a sub folder to open in a new window.  Can I go back to just double clicking ?

    With Mavericks I have to hold command key down and double click to get a sub folder to open in a new window.  Can I go back to just double clicking ?

    Of course. To do it, open a Finder window, go to Finder menu (on the menu bar) > Preferences > General, and untick "Open folders in tabs instead of new windows".

  • Outlook 2010 apostrophe, single and double quotes are changes to question mark while sending mails to other internet receipient.

    We are using MS Outlook 2010 as our mail client. But we have noticed that whenevr we sent a mail to any other internet mail recipient all the "apostrophe", "single" and "double quotes" have automatically converted to ?. We have
    done almost all the workaround found in this site such as
    1.New a message and focus on the message window > click File > Options > Mail > Spelling and Autocorrect… > Proofing > AutoCorrect Options… > AutoFormat > clear the box before “Straight quotes” with “smart quotes”
    2. Used different encoding. We presently using US-ASCII for outgoing message. etc.
    Need your help to sort out these issues urgently.
    Waiting for a solution.

    Hi,
    What is your account type? IMAP, POP or Exchange?
    Send an email from the webmail, ask the recipient if this issue persists.
    As far as I know, this problem is always related to the encoding for outgoing messages, and here I suggest you try UTF-8:
    Go to File -> Options -> Advanced -> International options -> Uncheck "Automatically select encoding for outgoing messages", then select "Unicode (UTF-8)" beside "Preferred encoding for outgoing messages" -> OK.
    Hope this helps.
    Regards,
    Melon Chen
    TechNet Community Support

Maybe you are looking for

  • External Mounted Hard Drive Icon Not Showing on Desktop nor on Sidebar

    Bonjour, I have a portable drive that does NOT show up in the Sidebar nor on the Desktop. The only way I can see and navigate through it is by clicking in Disk Utility > Mount Point: <hyper-link> Then hard drive icon and its content show up fine. But

  • How does message determination work?

    Hello, I should print an consignment settlement with MRKO. How can I define different output type for different company? I guess I should search the solution in SPRO Material management - Logistics Invoice Verification - Message determination but I d

  • My ipod is in recovery mode and the passcode lock is on, i cant connect it to itunes because of this. what do i do

    my ipod is on the connect to itunes screen and i connected it but itunes says cannot connect to ipod because its locked with a passcode. i called itunes support and they said it was in recovery mode and its a simple fix but i dont wnna pay 30 bucks.

  • Aperture 3 - Uploads to Flickr and MobileMe

    I've been using Aperture 3 on my nearly new iMac for almost a week. I decided to upload some photos to MobileMe and Flickr. The photos upload without problem and appear in the galleries in both cases. Its once the uploading is complete that the troub

  • Third party cables blocked?

    I got some third party USB cables for charging my iphone 5s, so I could charge it at work and in the car without unplugging the home one every time. They worked fine...until they didn't.  I've been seeing online many people who claim you can just doa