java - Which Way of List Initialize Is Better -


I was thinking, is the method of initializing the list better?


  Public Sector Main {Private Final List & lt; String & gt; L = New Arrestist & lt; String & gt; (); {L.add ("a"); L.add ("b"); L.add ("c"); }}  

  public class main {Private Final List & lt; String & gt; L = New Arrestist & lt; String & gt; () {{L.add ("a"); L.add ("b"); L.add ("c"); }}; }  

Former, since this is not an anonymous class;


Comments

Popular posts from this blog

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

php - What is the best way to get the URL of a 404'd file after redirect? -