Why does the following code create compile error? Doesn't charAt() method return char datatype?
public static void main (String[] args) throws java.lang.Exception
{
String a = "abcd";
char c = a.charAt(2)-'a';
}
error: incompatible types: possible lossy conversion from int to char