Original Post
Hello i'm fairly new to programming in Java and I have come across a problem import javax.swing.JOptionPane; class Exercise6 { public static void main(String[] args) { String response, a, b, c, d, e, f; int i; int[] grades; i = 1; grades = new int[5]; response = JOptionPane.showInputDialog("Enter Grade Mark" + i); if (response =="a" || response =="A"){ grades[0] = grades[0] + 1; System.out.println("ITS WORKED"); } else { response = "Must enter either A, B, C, D, E or F"; JOptionPane.showMessageDialog(null, response); } System.exit(0); } } the problem lies in the if statement for some reason when I put a or A in the little input box that appears it seems to read it as something else cause it makes both conditions false and skips to the else statement. I think its something to do with JOptionPane but I have no idea. I've tried just initilizing a varible with the value of A or a and skipping the JOptionPane thing and that worked. Any advice would be appreciated. Thank you