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
Post a Comment