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
Mainly Related to Oracle, DBMS , Oracle Stored Procedures, Functions, Oracle 9i Architecture, Redo logs..., Views,
When will you use shell script/Perl ahead of C/C++?
how to add Servlet-api.jar file into eclipse 3.3.2 ?
You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)
how we can know the funcions available in a class recording java?
Tips for blog integration by www.esteemwebsolutions.com. Can Any body suggest me to how to make wonderful questions on web integration..
how pseudo column works?
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.
I need to fetch all rows from the table based one field value in the table and later do a condition check if the condition is true I will have to move all the rows present in the data base to output file one else if the condition is not satisfied then move all the records of that field value into another file .Please let me know how to do that
i want to insert textbox value to sql db. i have only one text box but store four values. ple give any one give sample code in asp.net c#..
5.Call by value and Call by reference with program?
When we use Windows authentication mode
how does database connection using ADO.NET?
what is difference between object oriented programming structure and object oriented programming system?
write a sql qwery which include joining of two tables 4 marks mainframe