Assign variable in Java while-loop conditional?
问题 I have a method that does a lot of checking and computation and returns a custom class, returnMessage. returnMessage has 2 booleans and a String. What I want to do is run this method in a while loop from my main class and have access to the returnMessage object after the while loop terminates for the last time. In php this would be a case of while ( $returned = myObject->myMethod()->finished ) { } if( $returned -> finished == FALSE) { ... } However trying to assign like this gives me a