Too many characters in character literal error

后端 未结 2 1720
忘掉有多难
忘掉有多难 2021-01-15 16:21

I\'m creating a stylish text app but on some places I\'m getting an error (\"Too many characters in character literal\"). I am writing only one letter but when I paste it c

2条回答
  •  情深已故
    2021-01-15 16:42

    You can't do that with char data type. Use String instead.

    https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

    char: The char data type is a single 16-bit Unicode character. It has a minimum value of '\u0000' (or 0) and a maximum value of '\uffff' (or 65,535 inclusive).

提交回复
热议问题