yours is the generic problem of finding the distance between two points of a rectangular co-ordinate system when the co-ordinates of both the points are known.
your code exactly reflects the standard formula and IMHO cannot be bettered.
i'd assume u can use the static method Integer.parseInt(str) before simply adding them up using the operator '+'...
but then i might not have got ur problem right.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.