Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Valid parameter type of NumberFormat's format()

 
Faber Siagian
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raphael Rabadan
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Faber Siagian
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Raphael,
I've got it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic