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

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

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -