Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to swap values between two variables without using a
third variable?

Answer Posted / shyam sundar baishya

How to swap two String values without using a
third variable?

In Java::
=========
String s1 = "Shyam Sundar Baishya" ;
String s2 ="Dilip Kumar";
System.out.println("Before swapping ............");
System.out.println("s3 == "+s1);
System.out.println("s4 == "+s2);
s1= s1+s2;
System.out.println("....................");
System.out.println("After swapping ............");
s2 = s1.substring(0,(s1.length()-s2.length()));
s1 = s1.substring(s2.length(),(s1.length()));
System.out.println("s3 == "+ s1);
System.out.println("s4 == "+ s2);

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a sql qwery which include joining of two tables 4 marks mainframe

1939


what is the use MDM(Master Data Management)and meaning

2426


Tell me the jobs for the MCA Fresher in delhi, Noida..

2395


details description on this mantis? who is founder of this mantis?

2134


what is session state?

1966


What is SOLID Principle in Programming Language?

1225


Q1.Write a C program which asks the user for a number between 1 to 9 and shows the  number. If the user inputs a number out of the specified range, the program should  show an error and prompt the user for a valid input.

2728


Busy waiting is a method whereas a taskwaits for a given event by continiously checking for an event to occur. What is the main problem with this approach

1899


How to set fixed width in particular in html? if i type more character in this it will not push near . this is my question. can u tell me the answer...

2558


1.what is the vesition managment.

2192


what is radio button? Plz show code this! how will select radio buttons to go next window Forms? Supose o radio button1 o radio button2 o radio button3 o radio button4 how will coding this? Plz explain this!

3327


How do you initialize a static member of a class with return value of some function?

1186


Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.

1239


I want to pass .pdf files as OlE Object to crystal report through VB6. Please any one guid me...

3047


can any one suggestion me present which course(except java,.net) has huge demand in the market?

2068