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:
- How to Solve mybatis returns null when querying Oracle database with char type field
- How to fix “Outlook data file cannot be accessed” error (Solved)
- How to use scanner to accept char type characters in Java
- error: a label can only be part of a statement and a declaration is not a statement (How to Fix)
- How to Fix Warning: Statement lambda can be replaced with expression lambda
- error: unclosed character literal (How to Fix)
- How to Fix Session is not Connecting (How to Diagnose it)
- How to Fix stack overflow error
- HTTP Error 502.5 – Process Failure (How to Fix)
- How to Fix Your Timestep
- How to Fix errors in Chinese input of latex
- How to Fix java.net.ConnectException: Connection refused: connect
- How to Fix IWAB0489E Error when deploying Web service to Axis runtime
- How to Fix Error sal.h(2367)
- Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded (How to Fix)
- How to Fix Error: JavaFX cannot find fxml
- How to Fix Error CGContextSetStrokeColorWithColor: invalid context 0x0
- How to fix process system isn’t responding on Android?
- How to Fix Node.js connection to MYSQL error.
- How To Fix Windows Java Error 1723