- /**
- * Demonstrates the use of wrapper
classes
- *
- * @author TK Rogers
- * @version Dec 15, 2011
- */
- public class WrapperDemo {
- public static void
main ( ) {
- int num = 7, numsBase = 10 ;
- Integer i = new Integer ( 2 ) ;
- String s =
new String ( "3" ) ;
-
-
System.out.println ( "( s + s ) = " + ( s + s ) )
;
-
System.out.println ( "(int) s.charAt ( 0 ) = " +
(int) s.charAt ( 0 ) ) ;
-
System.out.println ( "( i + i ) = " + ( i + i ) ) ;
-
System.out.println ( "( i.intValue ( ) + i.intValue ( )
) = " + (i.intValue ( ) + i.intValue ( )) ) ;
-
System.out.println ( "( Integer.parseInt ( s ) + 3 ) = "
+ (Integer.parseInt ( s ) + 3) );
- System.out.println ( " s + Character.forDigit( num, numsBase ) = " + ( s + Character.forDigit( num, numsBase ) ) ) ;
- }
- }