public class IntegerTest { //----------------------------------------------------------------- // Calculates the final price of a purchased item using values // entered by the user. //----------------------------------------------------------------- public static void main (String[] args) { Integer intObj= new Integer(42); System.out.println("This program tests the methods of the Integer class"); System.out.println("method toString()\t\t -> " + intObj.toString()); System.out.println("method toBinaryString()\t -> " + intObj.toBinaryString(42)); System.out.println("method toHexString()\t -> " + intObj.toHexString(42)); System.out.println("method toOctalString()\t -> " + intObj.toOctalString(42)); System.out.println("method toString(x,2)\t -> " + intObj.toString(42, 2)); System.out.println("method doubleValue()\t -> " + intObj.doubleValue()); System.out.println("method floatValue()\t\t -> " + intObj.floatValue()); System.out.println("method intValue()\t\t -> " + intObj.intValue()); // Create an int from a String int val = Integer.parseInt("123"); System.out.println("\nval= " + val); } }