This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum 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
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Valid parameter type of NumberFormat's format()
 
Similar Threads
NumberFormat.format()
NumberFormat question
convert String->double->String
Formating number-Inputs by locale
Setting unveven intervals in JFreechart