error: char cannot be dereferenced
Error code
if(row.charAt(m).equals('0')){
matrix[i][j]=0;
}
Where the row is a string.
2. Error reason
Ross: Yeah, I mean, derefrence. The value that points to
The type char is a primitive — not an object — so it cannot be dereferenced
derefer0 derefer0 is The process of authentication The value green to by a reference. Since a char is already a value (not a) reference), it can not be dereferenced.
use Character class:
if(Character.isLetter())
char
char
char is a primitive type.
Character is its wrapper class, reference type, and equals() method. == instead of directly comparing values.
Read More:
- Java.lang.Character . isdigit() and isletter() methods
- The differences between the equals method in the string class and the equals method in the object class
- Parsing the exception of storing JSON string in cookie
- Pit encountered by entity class data type BigDecimal
- Generating equals/hashCode implementation but without a call to superclass
- error: unclosed character literal (How to Fix)
- Error of reading character c + +
- C++ cin.ignore Use of ()
- Java lossy conversion
- Use of C + + ifstream and error handling
- Brief introduction of idea Lombok and solutions for reporting red and wrong
- error C2137: empty character constant
- Write about the problems and solutions when configuring OpenGL in vs2015
- Python2 PicklingError: Can‘t pickle <type ‘instancemethod‘>: attribute lookup __builtin__.instanceme
- 43. Implementation of the shortest code of multiply strings | Java
- How to use scanner to accept char type characters in Java
- Difference between isempty method and isblank method in stringutils
- [Warning] incompatible implicit declaration of built-in function ‘strcat’
- Error c2137 of C language: empty character constant (Fixed)
- Perfectly solve the 1366 error of saving Chinese in MySQL