int[] a = new int[] {1, 2, 3};And
int[] a = {1, 2, 3};Are there any practical differences between those?
They are equivalent, no difference between the two.
new keyword creates an object.. and you're creating.. an array, which is an object.
See Chapter 10. Arrays:
In the Java programming language, arrays are objects (§4.3.1)...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With