Back To Java Flow of Control Index
//program to input a character and check whether it is equal to a or b using if statement example of OR ( || ) operator public class charequalaorb { public static void main(String[] args) { char ch; ch='a'; if((ch=='a') || (ch=='b')) { System.out.println("you entered either a or b"); } } }