Last active
August 29, 2015 14:16
-
-
Save johanrovala/020b0ad8595cb92b71a5 to your computer and use it in GitHub Desktop.
Problem with instantiating generic types.
This file contains hidden or 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
package Task2; | |
/** | |
* Created by Johan on 2015-03-11. | |
*/ | |
public class QueArr<T> { | |
private T[] arr; | |
private int first; | |
private int last; | |
private int length = 8; | |
public QueArr(){ | |
arr = new T[length]; // Type parameter 'T' cannot be instatiated directly | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment