Double( String ) not working [message #1823738] |
Wed, 01 April 2020 06:43 |
John Sharples Messages: 3 Registered: June 2019 |
Junior Member |
|
|
The following bog standard code returns the integer conversion but throws an exception in the double line. I have tried all three methods of converting double to string and get the same result each time.
// string to int
String s = "5";
int i = Integer.parseInt(s);
System.out.println("int value = " + i);
// string to float
double d = Double.parseDouble(s);
I've tried to catch the error code to no avail. What I get is this:
Premain$1.transform(ClassLoader, String, Class<?>, ProtectionDomain, byte[]) line: 48
TransformerManager.transform(ClassLoader, String, Class<?>, ProtectionDomain, byte[]) line: not available
InstrumentationImpl.transform(ClassLoader, String, Class<?>, ProtectionDomain, byte[], boolean) line: not available
FloatingDecimal.readJavaFormatString(String) line: not available
FloatingDecimal.parseDouble(String) line: not available
Double.parseDouble(String) line: not available
reNameTester.main(String[]) line: 29
I'm using Eclipse 20-03 IDE and all java items have been removed and reloaded more than once. Any suggestions will be gratefully received.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04637 seconds