String assihmn et question

in string operation i take string from user nd using the charat(0) method to extrct the character bt it show eroor

import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
char ch = str.charAt(0);
if( ch>=‘a’ && ch<=‘z’)
{
System.out.println(“lowercase”);
}
else if( ch>=‘A’&& ch<=‘Z’)
{
System.out.println(“UPPERCASE”);
}
else{
System.out.println(“Invalid”);
}
}
}