Logical Order Of Operations Java