FileDocCategorySizeDatePackage
Boxing.javaAPI DocExample1064Thu Dec 11 02:43:40 GMT 2003oreilly.hcj.tiger

Boxing

public class Boxing extends Object
Demonstration of the Boxing and Unboxing facility of Tiger, JDK 1.5.

Fields Summary
Constructors Summary
Methods Summary
public static final voidmain(java.lang.String[] args)

	 	someMethod((Integer)5);
	 	//someMethod((int)5);
	
public static voidsomeMethod(java.lang.Float x)

		System.out.println("Float");
	
public static voidsomeMethod(java.lang.Integer x)

		System.out.println("Integer");
	
public voidsomeOtherMethod()

		Integer[] values = new Integer[1];
		Number[] nums = values; // <== legal
		// String[] strs = values; <== illegal