wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes valueOf method() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "valueOf method()" Watch "valueOf method()" New topic
Author

valueOf method()

Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316


Can anyone tell how this statement is getting executed ???

Infact there is no such Static Method valueOf in Double class which takes double as an argument. It has the one with String.

Thanks !!!

SCJP 6.0 96%

(Connecting the Dots ....)
Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
Sahil Rally wrote:
Infact there is no such Static Method valueOf in Double class which takes double as an argument. It has the one with String.

Look here:
http://java.sun.com/javase/6/docs/api/java/lang/Double.html#valueOf%28double%29

Probably you read wrong API documentation, in Java 1.2 & 1.4 Double had only one valueOf(String) method,
but starting from Java 5 Double class has two valueOf methods.
When you use google to find API docs, always add "Java 6" as keyword.
Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316
Thankyou Ireneusz Kordal !!

You are right i was checking wrong API !!!
 
 
subject: valueOf method()
 
Similar Threads
Enum valueOf method
Wrapper classes: Sense of "valueOf" method?
HOw to convert BigDecimal to Double?
Wrapper class object creation question
null pointer exception