'?Invalid char constant compile error ?cannot able to declare in java
I am trying declare char constant in java it throwing invalid constant error.
public static final char code = 'RETURN';
Solution 1:[1]
A char represents a single character like 'C'. To represent a word you need a String variable such as:
public static final String code = "RETURN";
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | abdurrhman el shimy |
