Page 1 of 1

Compile Error-Double

Posted: Fri Oct 22, 2004 9:05 am
by luckyman
When I submitted 579, I got a Compile Error.
03001178_24.java: In class `Main':
03001178_24.java: In method `start()':
03001178_24.java:42: Can't find method `parseDouble(Ljava/lang/String;)' in class `java.lang.Double'.
h = Double.parseDouble(st.nextToken());
^
03001178_24.java:43: Can't find method `parseDouble(Ljava/lang/String;)' in class `java.lang.Double'.
m = Double.parseDouble(st.nextToken());
^
2 errors
I don't see any reason why i can't use parseDouble
Can someone plz help me

Posted: Fri Oct 22, 2004 12:52 pm
by Maniac
The judge uses java 1.1 (it's from the stone age, I know) and it doesn't support the parseDouble method.

Use this
[java]Double.valueOf(s).doubleValue();[/java]
instead of
[java]Double.parseDouble(s);[/java]

If you want, you can download the java 1.1 documentation. Then you can really find out how bad java 1.1 is :-) and what you can expect of course

Posted: Fri Oct 22, 2004 6:21 pm
by luckyman
Thanks for your help
I did not get a Compile Error this time
but i got a WA instead