public static void compareCharacters(char c1,char c2){
int cmp=Character.compare(c1,c2);
if(cmp>0){
System.out.println(c1+">"+c2);
}else if(cmp<0){
System.out.println(c1+"<"+c2);
}else{
System.out.println(c1+"="+c2);
}
}
If your input is a character and the characters you are checking against are mostly consecutive you could try this:
if ((symbol >= 'A' && symbol <= 'Z') || symbol == '?') {
// ...
}
don't forget to use single quotes('char') in stead of double quotes("String") like with String.