Arrays.asList

import java.util.Arrays;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        StringBuffer sb=new StringBuffer();
        String [] str= {"ipad", "mini", "8"};
        List<String> list = Arrays.asList(str);
        for (int i = 0; i < list.size(); i++) {
            sb.append(list.get(i)+" ") ;
        }
        System.out.println(sb);
    }
}

 

posted @ 2021-11-04 12:10  小啊菜鸡  阅读(43)  评论(0编辑  收藏  举报