Answers for "java: unclosed character literal"

0

java: unclosed character literal

Char comment in Java
Posted by: Guest on August-09-2021
0

java unclosed character literal

In Java, single quotes can only take one character, with escape if necessary. You need to use full quotation marks as follows for strings:

y = "hello";
You also used

System.out.println(g);
which I assume should be

System.out.println(y);
Note: When making char values (you'll likely use them later) you need single quotes. For example:

char foo='m';
Posted by: Guest on May-15-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language