Skip to content

Instantly share code, notes, and snippets.

@diaolizhi diaolizhi/0929.java
Last active Sep 29, 2018

Embed
What would you like to do?
创建指定含有泛型类型的类的数组
Stack<String>[] a = (Stack<String>[]) new Stack[N];
虽然 Stack 不是泛型类,但是它含有一个泛型参数。
所以下面这种方式会报错。
LinkStack<String>[] b = new LinkStack<String>[4];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.