Quantcast
Channel: java Syntax error on token "(", ; expected - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by AnOldSoul for java Syntax error on token "(", ; expected

You cannot create another function like that inside main function. Move the function out of the main function scope and call wherever necessary

View Article



Answer by Matthew Champion for java Syntax error on token "(", ; expected

As stated by ratchet freak, you need to move the function out of main. The function itself belongs to the Assignment1 class and as such needs to be:import javax.swing.JOptionPane;public class...

View Article

java Syntax error on token "(", ; expected

/*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...

View Article
Browsing latest articles
Browse All 3 View Live