hello, in the following code i try to compare to string objects, however, i dont know where is my error so please help me
public class Amr { private String word; public Amr(String str) { setString(str); } private void setString (String str) { this.word = str; } public boolean IsPloyndrome(Amr string) { if ( this.getString().equals(string.getString()) ) return true; else return false; } public Amr getString() { Amr obj = new Amr(word); return obj; } }
main method: