The problem is that "char" is not a class, is aprimitive type, so you can't call methods on a"char" variable, if you want to convert a charinto an int, you can do this casting:int index = (int) alpha;