Why does java print the value of the variable that is assigned it in the code below? I want understand what is happening here. 

My thought is that the expression inside println() method is evaluated first. For the first example, 5 is assigned to int x. At that point, does x become available for the println() method to print its value?

This code confuses me. I wouldn't have thought expression like x=5 could return a value. Thank you.

Examples:

```
int x;
System.out.println(x=5); //prints 5

boolean isValid;
System.out.println(isValid = true); //prints true

String fruit;
System.out.println(fruit="Orange"); //prints orange

```