Chen SanHau

Greenhorn

Posts: 27

posted 13 years ago

In Java, primitive types have associated wrapper classes,

like primitive type int VS Integer class etc,

But can I use objects of wrapper class to do operations of mathematics??

Or I should convert wrapper class to primitive type ???

Another question is about n! .When I write codes for practice,the result

of 5000! is too big. Should I use class

I need your help.

Thankx your help in advanced.

[ March 10, 2004: Message edited by: Ha LoHa ]

like primitive type int VS Integer class etc,

But can I use objects of wrapper class to do operations of mathematics??

Or I should convert wrapper class to primitive type ???

Another question is about n! .When I write codes for practice,the result

of 5000! is too big. Should I use class

*BigDecimal*or*BigInteger*in*java.math*package??I need your help.

Thankx your help in advanced.

[ March 10, 2004: Message edited by: Ha LoHa ]

Dirk Schreckmann

Sheriff

Posts: 7023

posted 13 years ago

No.

Yes.

Note that others have implemented their own "wrapper" classes which do provide methods for various mathematical operations.

Yes, you could do that.

*But can I use objects of wrapper class to do operations of mathematics??*

No.

*Or I should convert wrapper class to primitive type ???*

Yes.

Note that others have implemented their own "wrapper" classes which do provide methods for various mathematical operations.

*When I write codes for practice,the result*

of 5000! is too big. Should I use class BigDecimal or BigInteger in java.math package??

of 5000! is too big. Should I use class BigDecimal or BigInteger in java.math package??

Yes, you could do that.

Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |