how to swap to variables without using thrid variable in java?
Answer Posted / mani
int x = 15;
int y = 20;
System.out.println(x+" "+y);
x ^= y;
y ^= x;
x ^= y;
System.out.println(x+" "+y);
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is abstract class in oop?
What do you mean by Encapsulation?
Why do we use oop?
What is the benefit of oop?
What is meant by oops concept?
What is difference between data abstraction and encapsulation?
Can you inherit a private class?
Can a destructor be called directly?
Which method cannot be overridden?
What is the renewal class?
What is basic concept of oop?
What are the features of oop?
What is inheritance in oop?
What is the difference between static polymorphism and dynamic polymorphism?
What is polymorphism and example?