For me, Arrays.asList()
is the best and most convenient one. I always like to initialize that way.If you are a beginner in Java Collections then I would like you to refer ArrayList initialization.
↧
Answer by Manoj Kumar for Initialization of an ArrayList in one line
↧