I often see arrays being initialized like this:
String[] array = new String[] { \"foo\", \"bar\", \"baz\" };
But reading the Language Basic
Is there any difference between these?
There is no difference in the end result. However, as per the JLS § 10.6, you cannot use the array initializer synax in every context.
An array initializer may be specified in a declaration (§8.3, §9.3, §14.4), or as part of an array creation expression (§15.10), to create an array and provide some initial values.