Thread: toString method
View Single Post
  #3 (permalink)  
Old 01-30-2008, 10:45 AM
babadamale babadamale is offline
Member
 
Join Date: Jan 2008
Location: Pune
Posts: 1
babadamale is on a distinguished road
Send a message via Yahoo to babadamale
there is a small mistake in your toString() method.
public String toString(double add, double sub, double mult, double div)
{
add.toString(); <-- (mistake)
}

just typecast it into "Double" and then do whatever you want to do,like ...

public String toString(double add, double sub, double mult, double div)
{
(Double)add.toString(); //now "add" is an object of the type Double
}
Reply With Quote