getting an error
Preet Check your return type of method addition. Here you have returned Class actually it should return String. Update this method public Realnumber addition(Realnumber s) with this public String addition(Realnumber s)
Now I got it. The method addition of type Realnumber returns a new object and with the help of System.out.println I am calling the toString method, which prints the value of r
Preet Why RealNumber if you are returning String in your toString method. You are returning addition of two number not class.
Thank you Denise
Can somebody please tell me how to solve this problem?
The return type of the method should be of type Realnumber
Preet Yep, you got it :)