Last active
September 29, 2018 10:45
-
-
Save diaolizhi/4d4efa0f76c97d6523d42881eb440d6c to your computer and use it in GitHub Desktop.
创建指定含有泛型类型的类的数组
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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