Is it possible to compare two Char variables in if statement or in while loop?

Is it possible to compare two Char variables in if statement or in while loop?

char key;

if (key == "4") {

Do some work

}

Pls help.

Thanks.

key is a char. "4" is a string. See the problem?

Try'4' instead.

Thanks it worked.