Is it possible to do +- operations like this somehow?
BigInteger a = new BigInteger("1");
BigInteger b = new BigInteger("2");
BigInteger result;
a+=b;
//result = a.add(b);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately not. Operator overloading is not supported in the Java language. The syntax only works for the other numeric primitive wrappers via auto-boxing, which wouldn’t make sense for
BigIntegeras there’s no equivalent primitive.