I use this below code. Both are working fine in my application.
Case 1.
List<String> coreModules =
new ArrayList<String>(Arrays.asList(
"TOOLBAR_TO_DO_LIST",
"TOOLBAR_PROPERTY",
"TOOLBAR_PEOPLE",
"TOOLBAR_INSURANCE",
"TOOLBAR_BATCH",
"TOOLBAR_INFORMATION_REFERENCE",
"TOOLBAR_LR_PROPERTY",
"TOOLBAR_CASE_FOLDER",
"TOOLBAR_INSPECTION_RESULT",
"TOOLBAR_MY_OFFICE"));
Case 2.
List<String> coreModules =
Arrays.asList(
"TOOLBAR_TO_DO_LIST",
"TOOLBAR_PROPERTY",
"TOOLBAR_PEOPLE",
"TOOLBAR_INSURANCE",
"TOOLBAR_BATCH",
"TOOLBAR_INFORMATION_REFERENCE",
"TOOLBAR_LR_PROPERTY",
"TOOLBAR_CASE_FOLDER",
"TOOLBAR_INSPECTION_RESULT",
"TOOLBAR_MY_OFFICE");
But I have some questions:
Case 2 is better performance-wise BUT: it returns a List with an immutable size. Meaning you cannot add/remove elements to/from it:
Returns a fixed-size list backed by the specified array. (Changes to the returned list "write through" to the array.)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments