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 two String values without using a
third variable?

Answer Posted / shyambaishya

Using 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 ?    49 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a pseudo code to evaluate a number to any base given (2...16) based on the input. Number greater than 9 should be given as A-F for 10-15.

2432


How to change the color of a cell or a row in a datagrid on mouse hover using javascript/.net

1942


what are stubs related to foxpro?

2048


differences between qtp10.0 and 11.0 ?

2219


HOW TO FIND NUMBER OF TWOS IN N!(N FACTORIAL)??

2207


Is there any standard procedure to test the application as a whole? Or How can I test complete application right from the requirement gathering?

1876


Write a program to swap the content of two variables without using a third variable.

1017


What is SOLID Principle in Programming Language?

1136


write a query that returns one row for each department and the number of employees in that department. Given two tables EMPLOYEE and DEPARTMENT, where there can be multiple employees per department.

1544


what are other resources are needed for this mantis?

1897


hi i am jyoti i have done sap training in sd and master degree in economics have 2 year exp as enduser in (gdms)and 1 year as sd consultant.as contract basis now what i can do for getting job in it industry

2079


they asked me about srs (software requirement specifcation)? how can i get anydocumentation about srs & other documnts infomation like bdd, in testing? its urgent?

1875


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

2073


what is d main diff between the java and .net framework

1951


5. How do you round the addition or subtraction of two numbers in assembler?

2161