without using arthematic operation ,how can you write the
logic for adding/substraction/multiplication?

Answer Posted / ashwinkumar

int a = 10;
int b = 5;
int sum = BigInteger.valueOf(a).add(BigInteger.valueOf(b)).intValue();
int sum1 = BigInteger.valueOf(a).subtract(BigInteger.valueOf(b)).intValue();
int sum2 = BigInteger.valueOf(a).multiply(BigInteger.valueOf(b)).intValue();

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are bind parameters?

656


What is procedure writing?

593


What is procedure overloading?

1888


Can we override the private methods?

612


why are there separate wait and sleep methods? : Java thread

661






Why does my function print none?

612


How do you trim a space in java?

598


Differentiate between run time error and syntax error.

677


Give some features of interface?

682


Is assembly language a low level language?

581


Explain about method local inner classes or local inner classes in java?

667


What is difference between classpath and path variables in java?

660


What is a variable and constant?

654


What is object of class in java?

699


How can I debug the Java security exceptions and AccessControlExceptions?

757