switch (getChar)//<--You are passing charcter in switch case //but checking for 1,2 int as case 1,2... What you need to change is your case
as in switch you will be passing characters like a,b,c...
switch(getchar) { case 'a': //yourwork break; //do this for all letters } NOTE
Moreover for conactingconcacting String you should use StringBuilderStringBuilder (As Maroun Maroun) has already suggested and use stringBuilder.append('char') method to add your character to String builder directly no need to use String (i.e "a","b" etc.).