This question already has an answer here:
- The local variable xxx is never read 5 answers
When i try following java code
Assign false value to my boolean variable b and use it on if condition on the same statement
There is a message from eclipse IDE
Which hint me that "The local variable b is never read"
boolean b = false;
if (b = false) { // boolean assignment & usage on one statement
System.out.println("true");
}else {
System.out.println("false");
}
Kindly show why this message appeared although i use my variable?
Note : if condition is that b==false the message will not be shown
Aucun commentaire:
Enregistrer un commentaire