The comma (',') is a separator in Java. hence the line
int [] v = new int[2], i;
declares and initializes
v
as an array of
int
and declares
i
as an array of
int
as well (note
i
is left uninitialized).
Try
public class Foo
{
public static void main( String args[] )
{
int [] v = new int[2], i;
i = new int[3];
v[1] = 7;
i[2] = 42;
System.out.println(v[1]);
System.out.println(i[2]);
}
}