Interviews6 answers
What is the difference between int[] a and int a[] in Java?
6 Answers
In this query, int [] a and int a[] is no difference between this syntax
Deepak SharmaPosted Sep 3, 2023, 2:49 PM EDT
There is no difference in these two types of array declaration.
Sahi RepswalPosted Jul 24, 2021, 12:18 PM EDT
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.
Bhagyashri KadamPosted Apr 30, 2021, 9:37 AM EDT
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.
Aman GuptaPosted Jul 16, 2020, 1:44 AM EDT
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.
U DayPosted Sep 18, 2019, 8:02 PM EDT
Both will Do same Work
Arbab ArainPosted Sep 17, 2019, 7:45 AM EDT

