![]() |
Always returns false:
I have a method to test if a number is palendromic (the function is
public boolean isPalen(int n))It always returns false. Even if I change main to pass in a palendromic number directly. Why? Can someone give me some tips? Code:
public class Main { |
return (s1 == s2); compares the memory space of two objects. Strings cannot be compared this way, you must use s1.equals(s2). |
| All times are GMT +1. The time now is 10:38 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.