How to swap two String values without using a
third variable?
Answer Posted / badar awan
public class B
{
public static void main(String [] args)
{
String a = "Badar" ;
String b ="Asad";
a= a+b;
b = a.substring(0,(a.length()-b.length()));
a = a.substring(b.length(),(a.length()));
System.out.println("a == "+ a);
System.out.println("b == "+ b);
}
}
Is This Answer Correct ? | 9 Yes | 5 No |
Post New Answer View All Answers
Write a program to reverse a number?
Difference between delegates and Events?
what is the difference between uservariables and systemvariables (in Environmental variables)???
what is diff bet ref variable & instance of class
I am taking the bmc control m/enterprise manager 7.0 scheduling test and just wanted to see what kind of questions they would ask or if anyone has taken the test and how long it is for how many questions?
What is the use of Differ interface check box in Ship confirm?
Hi All, Can any one please send me the difference between informatica 7i and 8i versions, Thanks in advance. vinod
Q2. A memory location has physical address D5687h. Compute: a. The offset address if the segment number is D445h. b. The segment number if the offset address is B577h.
any drawback are there in mantis?
hi viewers, tell me,what is scripting and programming, define and difference...pls
what is the meaning of without standing arrears?
What r the attributes using in Win Runner?
how to work search engine? plz detail answer me.
What is autocall macro and how to create autocall macro? what is the use of it?
Given a set. Write the pseudo code to get all the subsets for the given set. Eg. Input : {1,2} Output : (),(1),(2),(1,2)