I create Vector and I want add Integer in vector. but "new Integer()" have error.
Vector<Integer> intergers = new Vector<Integer>();
intergers.add(new Integer());
what can i do?
now i use "Integer" & parameter like "new Integer(0)" but "new Integer(0)" have yellow underline. what can i do to remove this line?
ok, why The constructor Integer(int) is deprecated since version 9?
- ok! i found why.
"It is rarely appropriate to use this constructor. The static factory valueOf(int) is generally a better choice, as it is likely to yield significantly better space and time performance."
https://docs.oracle.com/javase/9/docs/api/java/lang/Integer.html
thx all