I\'m kinda waiting for a \'no\' answer on this question.
I was interested if you can save a variable at the same time when you checking it in an if-clause.
I have used that technique when iterating over lines from a BufferedReader:
BufferedReader br = // create reader
String line
while ((line = br.readLine()) != null) {
// process the line
}
So yes, you can do an assignment, and the result off that will be the left hand side variable, which you can then check. However, it's not legal to declare variables inside a test, as they would then only be scoped to that expression.