This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Valid parameter type of NumberFormat's format() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Valid parameter type of NumberFormat Watch "Valid parameter type of NumberFormat New topic
Author

Valid parameter type of NumberFormat's format()

Faber Siagian
Ranch Hand

Joined: Jul 08, 2008
Posts: 52
Taken from Whizlab and i've made a little modifications :




I expect compiler error at line 16, because java docs tells that the valid parameter of NumberFormat's format() is of type long or double, not a Number.


Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 (88 %)
Raphael Rabadan
Ranch Hand

Joined: Jul 05, 2008
Posts: 141
Originally posted by Faber Siagian:
Taken from Whizlab and i've made a little modifications :




I expect compiler error at line 16, because java docs tells that the valid parameter of NumberFormat's format() is of type long or double, not a Number.


Are you sure of it? I saw 7 overriden methods for format :-) Including one with Object parameter.


SCJP Java 6 (98%) - Story, SCJA (88%) - Story
Faber Siagian
Ranch Hand

Joined: Jul 08, 2008
Posts: 52
Ok Raphael,
I've got it.
 
jQuery in Action, 2nd edition
 
subject: Valid parameter type of NumberFormat's format()
 
Similar Threads
NumberFormat question
NumberFormat.format()
Setting unveven intervals in JFreechart
convert String->double->String
Formating number-Inputs by locale