0

I'm new to java (like a few weeks new), but coming from a C++ background..

This is going to sound retarded, but... can someone explain to me how I can make a BigInteger object to make it have the same value as another BigInteger object? That is they have to have the same value but be two different objects.. like a copy-constructor maybe??

And if I can't, due to the fact that java frowns on copy constructors, then why am I able to half-assedly get around this by doing something like
BigInteger foo = bar.add(BigInteger.ZERO);
where bar is another BigInteger

Thanks a lot, I've been able to find no info besides implementing Cloneable for my own classes.. this all seems really weird to me..

4
Contributors
4
Replies
6
Views
9 Years
Discussion Span
Last Post by destin
0

Just wondering... why do you want to do this? The BigInteger class is immutable, so two instances sharing memory will never be a problem.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.