There are no restrictions on the expression of conditional statements in if. In addition, there is no performance improvement in either of the two blocks.
The biggest difference between the two is that you do not have control over which condition did not work with the first.
Example:
if(a==1 && b==1) { //do something } else { //no way to tell which one failed without checking again! }
other:
if(a==1) { if(b==1) { //do something } else { // 'b' failed (meaning: b is not equal to 1) } } else { // 'a' failed }
source share