can we add two numbers without using arthematic operators?
if possible how?

Answer Posted / anandhakrishnan

import java.io.*;
class add
{
public static void main(String args[])
{
int a = 6;
int b = 3;
System.out.println("sum of a and b is :: "+(a|b));
}
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should the method invokelater() be used?

578


What is a treeset in java?

542


Can a main method be overloaded?

567


Why hashmap is used in java?

544


What does null mean in java?

624






What is java and why do we need it? Explain

581


What is the difference between I ++ and ++ I in java?

501


What is the primary benefit of encapsulation?

554


Differentiate between overriding and overloading cases?

590


Using callable statement how can you pass out parameters, explain with example?

578


What are the different types of constructor?

518


What is appletviewer?

562


How do you convert an int to a double in java?

590


What does it mean to be immutable?

544


Why do we use predicate in java?

548