+ 3
Why Charactor ch="o"; is not valid in Java?
2 odpowiedzi
+ 5
char ch='o';
+ 2
You should use a single quote to represent a character in Java. otherwise, if you use double quote, even for a single character, it will rather be treated as a string. example:
char ch='o';//character
char ch="o";//error
String ch="o";//string
:)