How to swap values between two variables without using a
third variable?
Answer Posted / neha
class SwapBitwise
{
public void SwapByBitwise(int x, int y)
{
x =x ^ y;
y = x ^ y;
x = x ^ y;
System.out.println("x : " + x + " " + "y :" + y);
}
}
public class SwapOperation
{
public static void main(String[] args) {
SwapBitwise obj = new SwapBitwise();
obj.SwapByBitwise(200, 300);
}
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How does the TCP handle the issue of multiplexing?
Write a shell program. Enter number of days from keyboard. Find out the number of years, month and days it contains
if 3 duplicate records, by keeping one original and one duplicate record, and how to delete remaining 2 duplicates in sql server 2008
Hi guyes, I have cleared 2 technical rounds with cts for liferay and java techonologies, i have client round next week, please tell me how to prepare for this what questions i should be ready to face?
what is web configuration file
Have you used callsymputx? what points need to be kept in mind when using it?
How to know we are in home page of a web application using QTP
could u please also write an example of a code that involves instances from an abstract class just as u did for interfaces because u said it could also work which i really doubt. thanks
What is the difference between WebIntelligence and Designer in creating universes?
ok how would i do the following extract from a file i have ssns = 267907230 which are in column 7 into a separate data set then create a 2nd job step to extract from the data set created the following "fund code" which is in column 31 and is 113 into yet another data set
Find out the roles which gives access to all tables in SAP? Thanks in advance.
Write a program to find duplicate number from array in minimum time complexity.
As per interoperatbility programs written in one language can be used by other language. How can we restrict the features of one language (say C#) in the programmer written in another language (say VB)..for example we have some features like operator overloading which is possible C#.NET (not in VB.NET), how can we restrict that when we are using this code in VB.NET.
public static void main(String args[]) describe it
Bonjour, svp je veut voir comment envoyer un mail en java et comment changer le droit d'accé d'un fichier en java: de lecture en lecture/écriture et merci d'avance ;)