How to resolve “Syntax error on token ”else“” in Java?
问题 I am new around here but let's get straight to the question: When I was writing the following code for a class project calculator I came across a "token error". This is the full error message: Exception in thread "main" java.lang.Error: Unresolved compilation problem: Syntax error on token "else", delete this token at calculatorApplet.main(calculatorApplet.java:42) I wrote this code: import java.util.Scanner; import javax.swing.JOptionPane; public class calculatorApplet { Scanner sc = new