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

In an customer exit (include Z) program, only the last record is getting fetched. The exit is getting called after pressing save button. What to write for fetching the first record ? Before saved to a SAP table how can i call all these records in an itab in the exit ?

1929


1. Consider the following code in our example assembly language: ; an example bit of assembly code ROOT: W FATHER FATHER: W SON1 W SON2 SON1: W NIL W NIL ; ---------------------- SON2: W GRANDSON W NIL GRANDSON: W NIL W NIL NIL = 0 Assemble this code carefully following the two pass model, and show the symbol table at the point marked by the dashed line during each pass.

2252


Why did you ever become involved in QA/testing?

2007


Which CRM is better to opt, Sebiel CRM or Salesforce CRM or sap CRM? which institute is best one in hyderabad

2263


what are the things i had to say in personal introduction in hr round mail me to prasanna.1867@rediff.com

2092


how to stop execution of step 3 in a job mainframe

2112


I am work in it aompenei

1406


Write a program to reverse a number?

1139


how do u handle table control inbdc explain the process in steps iwant the answer in urgent please forward this even i know how to explain there

2180


I want Ada programming language books. Could anyone post me any link for that?

3346


what is the basic and unique feature of dotnet

2195


what is dot net framework

2784


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

2092


in teradata level primary in table level allows duplicates why?

2054


when a query is made on Logical file in DB2/400, will the records satisfying select/omit criterion be fetched from all members of physical file or only the member with same name as physical file?

2096