ArrayList<StringBuilder> al = new ArrayList<>(
Arrays.asList(new StringBuilder[]{
new StringBuilder("Oracle"),
new StringBuilder("Java"),
new StringBuilder("Sun"),
new StringBuilder("DataBase")}));
StringBuilder[] al2array = (StringBuilder[]) al.toArray();
如果al.toArray()
返回 anObject[]
我知道它实际上是 a StringBuilder[]
,那么为什么我不能转换它?