Google News
logo
Java - Interview Questions
Difference between a[] and []a in Java?
You can declare an array in Java by either prefixing or suffixing [] with variable. There is not much difference between them if you are not creating more than one variable in one line, but if you do then it creates different types of variables, as shown in following example :

int a[], b; // first is int array, second is just int variable
int[] c, d; // both c and d are integer array
Advertisement