(e-mail address removed) took the hamburger meat, threw it on the grill,
and I said "Oh Wow"...
Hi calvin
Number is Super class of Integer, Float, Long, Double etc. and this
class is abstract class so you need to pass the the object of any
subclass of it.
By keeping the signature of this method with Number parameter , it is
being generalized ie you can pass any number object to this function.
HTH?
Take Care,
Gaurav Daga
<SSCCE>
public class TestNumber {
public void doIt() {
Number aNum = new Float(123.45);
testNum(aNum);
}
public void testNum(Number n) {
System.out.println(n.toString());
}
public static void main(String[] args) {
TestNumber tn = new TestNumber();
tn.doIt();
}
}
</SSCCE>
--
trippy
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM
NP: "Aces High" -- Iron Maiden
"Now, technology's getting better all the time and that's fine,
but most of the time all you need is a stick of gum, a pocketknife,
and a smile."
-- Robert Redford "Spy Game"