动态代理
Interface proxy = (Interface)Proxy.newProxyInstance(
Interface.class.getClassLoader(),
new Class[] { Interface.class },
new DynamicProxyHandler(real)); // DynamicProxyHandler要实现InvocationHandler接口
声明一个数组和打印一个数组
String[] aArray = new String[5];
String[] bArray = { "a", "b", "c", "d", "e"};
String[] cArray = new String[]{ "a", "b", "c", "d", "e" };
System.out.println(Arrays.toString(cArray));
从数组创建ArrayList
String[] aArray = { "a", "b", "c" };
List<String> aList = new ArrayList<>(Arrays.asList(aArray)); // 这种方式要慢一点
List<String> bList = new ArrayList<>();
Collections.addAll(bList, aArray); // 这种要快点
转载于:https://www.cnblogs.com/sycamore/p/4657687.html