I have two classes:
public class ClassA { public void method(Number n) { System.out.println(\"ClassA: \" + n + \" \" + n.getClass()); } }
because number 3 is automatically boxed to Integer.
please see the link below: http://www.javabeat.net/articles/print.php?article_id=31
General Rule: Arguments are implicitly widened to match method parameters. It's not legal to widen from one wrapper class to another.