aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Float blues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Float blues" Watch "Float blues" New topic
Author

Float blues

bobby chaurasia
Ranch Hand

Joined: Mar 30, 2002
Posts: 84
One of Dans test ( Chapter 10, exam2, Q no 5)
reads as
public static void main( String args[]){
Float f = new Float("1.0");
Float f1 = new Float("1.0f");
Float f2 = new Float("Infinity");
Float f3 = new Float("-Infinity");
Float f4 = new Float("NaN");
}
When I tried to compile, it gave me NumberFormatException.
The answer given is that it should compile and run okay.
Any clues why its not compiling ?
Thanks...
bobby chaurasia
Ranch Hand

Joined: Mar 30, 2002
Posts: 84
A minor correction, it compiled okay but on running it gave this error.
Thanks
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Funny, on 1.4.1_01 it compiles and runs OK.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
Don't get me started about those stupid light bulbs.
 
subject: Float blues