here's what I'm getting
/tmp/31686/palindrome.java:17: cannot resolve symbol
symbol : method subString (int,int)
location: class java.lang.String
else if ( e == g[b] . subString(0, g.length() -2))
/tmp/31686/palindrome.java:30: cannot resolve symbol
symbol : method subString (int,int)
location: class java.lang.String
g = g[b] . subString(0, g.length() -3);
/tmp/31686/palindrometest.java:9: cannot resolve symbol
symbol : constructor palindrome (java.lang.String,java.lang.String)
location: class palindrome
palindrome test =
new palindrome (g,e);
3 errors
and here's my code
import javax.swing.*;
class palindrometest
{
public static void main(String args[])
{
String g = JOptionPane.showInputDialog("Enter a palindrome");
String e = "";
palindrome test = new palindrome (g,e);
}
}
import javax.swing.*;
class palindrome
{
public static String palindrome (String g, String e)
{
boolean pali = false;
String result = "That is a " + pali + " palindrome";
if ( e == g )
{
pali = true;
JOptionPane.showMessageDialog(null,result);
}
else if ( e == g.subString(0, g.length() -2))
{
pali = true;
JOptionPane.showMessageDialog(null,result);
}
else if ( g == "")
{
pali = true;
JOptionPane.showMessageDialog(null,result);
}
else
{
e = e.concat(Character.toString(g.charAt(g.length()-1)));
g = g.subString(0, g.length() -3);
palindrome ( g, e);
}
}
}