Initialization of an ArrayList in one line
Actually, probably the “best” way to initialize the ArrayList is the method you wrote, as it does not need to create a new List in any way: The catch is that there is quite a bit of typing required to refer to that list instance. There are alternatives, such as making an anonymous inner class … Read more