You can either use array declaration or array literal (but only when you declare and affect the variable right away ... For classes, for example String , it's the same:
stackoverflow.com