What is the difference between Integer.valueOf() and Integer.parseInt() ?
1. Integer.valueOf() returns an Integer object while Integer.parseInt() returns a primitive type. // Program to show the use // of Integer.parseInt() method class Test1 { public static void main(String args[]) { String s = "77"; // Primitive int is returned int str = Integer.parseInt(s); System.out.print(str); // Integer object is returned int str1 = Integer.valueOf(s); System.out.print(str1); } } Output: 7777