Java 型別 List 當使用Arrays.asList時無法 add()、remove()
No Comments

發布:
更新:2015-05-17 20:23:46

因為Arrays.asList會強制固定長度。

只能用以下方法把Array宣告成List,可以正常使用。

List<String> list = new LinkedList<String>(Arrays.asList(split));

僅此作為筆記。


This entry was posted in Experience, Functions, Java By Weil Jimmer.

About Weil Jimmer

Hi! Everyone! My name is Weil Jimmer. This is my personal blog. I'm a webmaster of this site. I hope the site will be popular. Now, Let's go! Enjoy gaining more knowledge.
More Details About Me : https://weils.net/profile.php


Leave a message.

Only the first 10 comment will show.