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
V2 SOLUTIONS APTI paper is very easy there are 3 sections 1'st is quant problem on age train traveling speed is given length of train is given we have to find out length of bridge then prob on calender one date is given on Friday hv to find out day of othe date ans is Friday then there was 1 prob on percentage which was very easy ans was 21340 then 2’nd section was english grammer had has been being like that hv to fill in the blanks was very wasy then last section was find relative words there was five Q 1 pant ANS:-breath 2inquire ans :- ask And 3 more out of that 1 ‘s ans was:- body 4 And others ans was :-through THEN THEY HAVE GD There was three topics 1 should we allow india’s talent to go to abrod 2 protest against seperate state is justify 3 inturuption of politics in cricket Thats all guys i cleared both the rounds now preparing 4 interview best of luck
sample and simple coding where we get?
smal talk is pure object oriented or not?
EXPLAIN UNARY OPEARATORS
what is the difference between SCAN AND CHECK,LOKUP AND XFOOT? where we can use thease opcodes? Can any body tell me real time senariao with example?
How to merge Action Form with Dyna Action Form in Struts.
Given: coordinates of rectangle-> left bottom and right top points. the rectangles create a hole.Find the maximum area of the hole. eg. 4 rectangles create a hole in between. find its area.
what are the advantages of sap on other software ?
how to check single or double byte in struts
1. Consider the following input and generate the object code using single pass assembler. JOHN START 0 USING *,15 L 1,FIVE A 1,FOUR ST 1,TEMP FOUR DC F’4’ FIVE DC F’5’ TEMP DS ‘F END
Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming
Write a program to create a process in UNIX
how to work search engine? plz detail answer me.
what is the difference between Windows application and Unix application?
Hey this is venkatesh.Please can any body tell me what is SFLNXTCHG?where we use this keyword?what perpuse we use this?Can you tell me in real time senario with example? And in 7 specification(RPG/400)what is the mandatory specification using programs?