java unclosed character literal

Solutions on MaxInterview for java unclosed character literal by the best coders in the world

showing results for - "java unclosed character literal"
Charlton
13 Nov 2017
1In Java, single quotes can only take one character, with escape if necessary. You need to use full quotation marks as follows for strings:
2
3y = "hello";
4You also used
5
6System.out.println(g);
7which I assume should be
8
9System.out.println(y);
10Note: When making char values (you'll likely use them later) you need single quotes. For example:
11
12char foo='m';
Regina
13 Mar 2019
1Char comment in Java