Check out example codes for "java declare an int inside an if statement". It will help you in understanding the concepts better.

Code Example 1

int v; // separate declaration
if((v = someMethod()) != 0) return true;

Learn ReactJs, React Native from akashmittal.com