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

How would you dynamically allocate memory to an array?

597


Which package is imported by default?

637


How do you create a bulleted list?

567


What is the use of keywords in java?

555


Is array an object in java?

556






What is the difference between the font and fontmetrics classes in java programming?

505


Why synchronization is important?

589


Can we have two main methods in a java class?

540


How we can make copy of a java object?

655


What is hashing principle in java?

552


What is sortedset in java?

575


Should database connections be singleton?

570


Explain the selection sort algorithm and state its time complexity?

612


What is thread life cycle in java?

586


What are filterstreams?

615