package input;
import javax.swing.JOptionPane;
public class Input {
public static void main(String[] args) {
int user;
user = JOptionPane.showMessageDialog(null, "Enter Your Age""); ERROR IS HERE
if(user <= 18) {
JOptionPane.showMessageDialog(null, "User is legit");
}
else {
JOptionPane.showMessageDialog(null, "User is not legit");
}
}
}
Hello, can you please help me about this code, I'm new to Java, I'm getting this error message :
incompatible types: void cannot be converted to int
unclosed string literal
Thanks a lot!!!