java - What is the variable 'i' mean after the array declaration -


i came across java program merge sort numbers. here snippet of code bit confused with.

int n; scanner in=new scanner(system.in); n=in.nextint(); int []=new int[n],i; for(i=0;i<n;++i) 

in above code line int []=new int[n],i;what i stand for. declaration of int variable called i? or have meaning. advice appreciated.

it declaration of int type variable. more better declare int i in for this

for(int = 0; < n; ++i) 

also more whitespaces increase code readability

you can declare variables type var1, var2, var3, ..., varn;

and variables have same type


Comments