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
MOV.CB 007H,ADCON1 MOVE.CT 001H,_OPTION_REG_7 MOV.CB 007H,CMCON
I m new to the dbms. Recently i came across words clustered indexes & nonclustered indexes but i dont know what is this all about & whats the difference between them.. So please help me!!!!!!!!
What is the use of sas software? Is sas and sap are different?
Can any one give an example (Source Code) on virtual function implemetation in Java?
Which CRM is better to opt, Sebiel CRM or Salesforce CRM or sap CRM? which institute is best one in hyderabad
what is the similarity between networking devices?
what is client server & server? What r types of Joins? explsin it! which types of indexex in sql server? what is triggers?
For a binary tree with n nodes, How many nodes are there which has got both a parent and a child?
Hi can you please send me recent(present) interview questions and technical qyestions with answers for "BUSSIESS OBJECTS" and "DATA WAREHOUSE".pls its urgent for me my mail id is sekhar.cs82@gmail.com,manjuforgis@gmail.com. thanks in advance
3. What is the difference between testing and Quality Assurance?
hai i am prasanna.I am MCA 2009 fresher.tell me about certifications.which certification helps me to improve my carrier and to get a technically oriented job ,which certification helps to get job faster.
What is easiest way to get the PL/i compiler,I didn't have found the compiler in my library. Is there any extra cost if we want to access the PL/1 programs?Actually we r having Mainframe rented training Ids
Difference between delegates and Events?
how do we provide security for web services
I'm new to ABAP. What is Module pool in SAP?