How to create a variable of type Character

Hi All,

I would like to create a variable of type Character, means which accepts single character. Not the string. Can someone help me how to represent the char value. I tried using the data type as System.Char and the value = ā€˜Cā€™. But I am getting the compilation error

Hi Team,

I got the answer at
char gender = "R"c

Thank you

2 Likes

@tulasi26ram

Remove that single quote and then try it.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.