Hi!
I’m just beginning to learn Java and i was wondering if how is it possible to put array elements in multiple lines when declaring an array.
The following code gives me an error:
public String[] songList = {'Stadium Arcadium', 'Make You Feel Better', 'Under The Bridge',
'Wet Sand', 'Californication', 'Charlie', 'Aeroplane', 'Transcending', 'Ethiopia'};
Thank you very much!
Yes, you can put your strings on multiple lines.
However, use double-quotes to surround your String literals:
Here’s a link about String literals