What is the difference between int[] a and int a[] in Java?
Vijay Kumari
Select an image from your device to upload
Both will Do same Work
There is no difference in these two types of array declaration.
There is no such difference in between these two types of array declaration. It’s just what you prefer to use, both are integer type arrays.
There is no difference in functionality between both styles of declaration. Both declare array of int. But int[] a keeps type information together and is more verbose so I prefer it.
They are semantically identical. The int a[] syntax was only added to help C programmers get used to java. int[] a is much preferable, and less confusing.