Emmanuel Aron wrote:
When you write : Integer.valueOf(1); or System.out.println( Integer.valueOf(1) ); you don't have a compilation error, but when you look at the API of Integer.valueOf you see that it takes only a String as the argument...
You may be looking at an old API
doc. A valueOf() method that takes an int, was added to the Integer class, with the release of
Java 5. I recommend using a Javadoc that matches the version of Java that you are using -- otherwise you will be using incorrect information.
Henry