The catch is that there is quite a bit of typing required to refer to that list instance. Java: Initialization of an ArrayList in one lineĪctually, 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: ArrayList list = new ArrayList() Please avoid copyrighted materials.]ĭo not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |