My code:
String blockstates = '{\n\t"variants": {\n\t\t"":"model":"mod:block/' blockname " }\n\t}\n}";`
The error that I am getting is an Invalid Character constant of '{
at the start of the string. Is there a way I can fix this?
CodePudding user response:
Strings in java are enclosed in "
. you are using '
. Correct way to write :
String blockstates = "{\n\t\"variants\": {\n\t\t\"\":\"model\":\"mod:block/\" blockname \" }\n\t}\n}";
CodePudding user response:
Characters in java are enclosed in ' (single quotes)
Character char = 'c'; //correct
Character char = 'cc'; //will not compile