Prerna,
As Rick pointed out, you can perform the + operation only on
string and numeric primitives. Your return type is an object: distances.
Secondly, you do not need to instantiate a new Distances in the same class, coz u can use the private variables (they are not local, they are instance variables) as they are.
Also, I didnt quite get the purpose behind declaring distance1 in the main method.
You need to change your methods and return types in Distances to make this function work.
Have a good one!
-Kiennjal
[ April 01, 2005: Message edited by: kiennjal shah ]
[ April 01, 2005: Message edited by: kiennjal shah ]