fork download
  1.  
  2. public class PalindromeSimple {
  3. public static Boolean isPalindrome(String str) {
  4. return str == str.reverse();
  5. }
  6. }
Success #stdin #stdout #stderr 0.01s 8928KB
stdin
System.debug(PalindromeSimple.isPalindrome('madam')); // true
System.debug(PalindromeSimple.isPalindrome('hello')); // false
stdout
Object: UndefinedObject error: did not understand #PalindromeSimple
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject class(Object)>>doesNotUnderstand: #PalindromeSimple (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:2)
stderr
./prog:3: parse error, expected '}'