Java 数据类型转换

1. Array 转 List

public class Test {
    public static void main(String[] args) {
        List stringA = Arrays.asList("hello", "world", "A");

        String[] stringArray = {"hello", "world", "B"};
        List stringB = Arrays.asList(stringArray);
 
        System.out.println(stringA);
        System.out.println(stringB);
    }
}

 

你可能感兴趣的:(Java 数据类型转换)