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
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 ?
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.
Why did you ever become involved in QA/testing?
Which CRM is better to opt, Sebiel CRM or Salesforce CRM or sap CRM? which institute is best one in hyderabad
what are the things i had to say in personal introduction in hr round mail me to prasanna.1867@rediff.com
how to stop execution of step 3 in a job mainframe
I am work in it aompenei
Write a program to reverse a number?
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
I want Ada programming language books. Could anyone post me any link for that?
what is the basic and unique feature of dotnet
what is dot net framework
details description on this mantis? who is founder of this mantis?
in teradata level primary in table level allows duplicates why?
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?