for example,
import javax.swing.*;
public class testing{
public static void main(String[] args){
{
String input1 = JOptionPane.showInputDialog(null, "Pls input A or M", JOptionPane.QUESTION _MESSAGE);
If (input1 == A) {
System.out.println("Auto");
}
}
}
Thanks for any advise.
更新1:
Thank you all. Both answers are help and one more questions, If I want the if statement can allow either "A" or "a" character, how do i do it on the same example, Thanks all.