+ 1
Invalid character constant
Hello, I have a Code in that there is a variable called loesung. I want so set this variable to ".-". But it doesnt work. Can somebody help me? Thank you! char loesung = '.-';
4 Answers
+ 12
Becz char type veriable does not contain two characters.
Use String
String loesung = ".-";
+ 13
Keep in mind that whenever you use the A string variable, keep any character inside the double quto like this ("hello")
+ 3
With String i have the same Error.
+ 3
use String or try a char array :
char []c={'.','-'};
System.out.print(c[0]+""+c[1]);