Error: unreachable statement
The cause of this error is just like its name. The compiler will never execute it
the following situations will occur: unreachable statement:
(1) write a statement after the return statement
(2) write a statement after the throw statement
(3) define statements after the break and continue statements
(4) “\ u10100″// legal, equivalent to ‘\ u1010’ and string “0”
(5) the shift operator can be used for long int char short byte
(6) the access control character of a class can be public or nothing
(7) goto is a reserved word but not a keyword. Then is nothing
(8) when a superclass type is cast and assigned to an object of a subclass, there is no exception in compilation, but an exception will occur at run time
for example:
while(i<length&&len>0){
if(strs[i].contains(com.substring(0,len))){
continue;
i++;
}else{
len--;
}
}
You can see that the position of I++ in this code is after its continue. After the compiler executes here, it will directly carry out the next cycle, and I++ will never execute.
Read More:
- [How to Solve] Invalid bound statement (not found)
- Ternary operator in Java?: error: not a statement
- Mybatis plus configuration console prints complete SQL statement with parameters
- HQL statement query error: could not resolve property [Solved]
- How to Solve Mybatis error: invalid bound statement (not found)
- [Solved] Mybatis-Plus Error: Invalid bound statement (not found)
- [Solved] Mybatis Batch Modify Error: multi-statement not allow
- Mybatis Error: Invalid bound statement (not found)
- How to Solve Error: Invalid bound statement (not found)
- Springboot mybatis Integrate Error: Invalid bound statement (not found): com…DepartmentMapper.save
- There was an unexpected error (type=Internal Server Error, status=500).Invalid bound statement (not
- [Solved] JAVA Operate Database Error: You have an error in your SQL syntax; Dao layer SQL statement error
- Using mybatis statement.getGenreatedKeys(); usegeneratedkeys = “true”; using self incrementing primary key to get primary key value policy and Oracle do not support self incrementing, Oracle uses sequence
- C# Bug Fixed InvalidCastException: Cannot cast from source type to destination type.
- Error: char cannot be dereferenced [How to Solve]
- [Solved] ClickHouse Error: Code: 62. DB::Exception: Syntax error (Multi-statements are not allowed): fai
- JAVA: Random access file is always garbled
- How to Download File via Response (Example Code)
- [Solved] Java.util.linkedhashmap cannot be cast to entity class
- [Solved] IDEA error: sun.security.pkcs not found