Sir not getting this?

import java.util.Scanner;

class Patterntry {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
String str = scn.nextLine();
if (str >=“a” && str <=“z”) {
System.out.println(“lowercase”);
} else if (str >= “A” && str <= “Z”) {
System.out.println(“UPPERCASE”);
} else {
System.out.println(“Invalid”);
}

}

}

@Harsh_Sonwani,
https://ide.codingblocks.com/s/265494 corrected code.

For characters use single quotes ( ’ ’ ) instead of double quotes (" ").

For single char input we do:
char str = scn.next().charAt(0);

You were taking input as string and then comparing the string with another string “a” and “z”. Which is wrong.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.