Serious generics issue: int vs. Integer java
问题 for a long while, i have been trying to get a piece of code to work, and it just is not possible. the class i have requires a generic which i have set to Integer. so i tried the follwoing: public class a<T> //set generics for this function { private T A; protected boolean d; public a(final T A) { this.A = A; //do calculations //since constructor cannot return a value, pass to another function. this.d = retnData(Integer.parseInt(A.toString()) != 100); //convert to an integer, the backwards way