my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes quiz on Float.parseFloat(String) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "quiz on Float.parseFloat(String)" Watch "quiz on Float.parseFloat(String)" New topic
Author

quiz on Float.parseFloat(String)

Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
A quiz on valid values for Float.parseFloat(String)(String)
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
Answers:
// f = Float.parseFloat(s); //java.lang.NullPointerException
// f = Float.parseFloat(s); //java.lang.NumberFormatException: empty String
2.0
s= 4.9E-324
0.0
s= -4.9E-324
-0.0
s= 1.7976931348623157E308
Infinity
s= -1.7976931348623157E308
-Infinity
2.0
0.0020
2.0
// f = Float.parseFloat(s); //java.lang.NumberFormatException: For input string: "NAN"
// f = Float.parseFloat(s); //java.lang.NumberFormatException: For input string: "infinity"
NaN
-Infinity
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: quiz on Float.parseFloat(String)
 
Similar Threads
java.lang.Number
Q. on wrapper class Double
1.0/0.0 -1.0/0.0 0.0/0.0
Math.abs()
MATH Problem - Shor.MIN_VALUE