My professor said that we need to input a letter to the dialog box in order for regular, probation etc. to show. I don't know how to resolve this problem. Is there something wrong? I'm new to java.
Here's my code:
import javax.swing.*;
public class EmployeeCode_input
{
public static void main (String[]args)
{
char EC;
EC=Character.parseChar(JOptionPane.showInputDialog("enter employee code"));
if ((EC=="R")&&(EC=="r"))
System.out.println("Regular");
else if((EC=="P")&&(EC=="p"))
System.out.println("Probationing");
else if((EC=="T")&&(EC=="t"))
System.out.println("Trainee");
else if ((EC=="C")&&(EC=="c"))
System.out.println("Contractual");
else
System.out.println("INVALID");
}
}