How to use Logic Oparetor "And" in java

How to use Logic Oparetor "And" in java

public class AndOparetorDemo {
   
    public static void main(String[] args) {
       
        Scanner input = new Scanner(System.in);
       
        char ch;
       
        System.out.print("Enter A Letter : ");
        ch=input.next().charAt(1);
       
        if(ch>='a' && ch<='z'){
            System.out.println("Small Letter");
        }
        else if(ch>='A' && ch<='Z'){
            System.out.println("Capital Letter");
        }else{
            System.out.println("Not a Letter");
        }
    }
}

Run This code in Any Jabva editor(copy and paste this code)
*Stay With us*

How to print Vowel or Consonant condition in Java(without Logic Oparetor)

How to print Vowel or Consonant condition in Java(With Logic Oparetor)

How to download netbeans with Link


Share This BlogSite With Your Friend

Home

Comments