Quantcast
Channel: java Syntax error on token "(", ; expected - Stack Overflow
Viewing all articles
Browse latest Browse all 3

java Syntax error on token "(", ; expected

$
0
0
/*help me to correct this error*/import javax.swing.JOptionPane;public class Assignment1{    public static void main(String args[])    {        String input = JOptionPane.showInputDialog("Enter a string");        if (istPalindrome(input))        {            JOptionPane.showMessageDialog(null,input+"is a palindrome");        }        else{            JOptionPane.showMessageDialog(null ,input +"is not a palindrome");        }        public static boolean istPalindrome(String a)/*error is here*/        {            char[] charArray = word.toCharArray();            int i1 = 0;            int i2 = word.length() - 1;            while (i2 > i1) {                if (charArray[i1] != charArray[i2]) {                    return false;                }++i1;                --i2;            }            return true;        }    }}

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>