write a code in jsp to swap two numbers?

Answer Posted / rakesh.fanu

class SwapingTest
{
public static void main(String xx[])
{
int a,b,temp;
a=10;
b=20;
System.out.println("Before Swaping :-");
System.out.println("Value a is "+a);
System.out.println("Value b is "+b);
temp=b;
b=a;
a=temp;
System.out.println("After Swaping :-");
System.out.println("Value a is "+a);
System.out.println("Value b is "+b);
}
}

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between map and flatmap in java?

486


What is loose coupling in java?

469


Java prints out a ton of digits when I system.out.println() a double. How can I format it so it displays only 3 digits after the decimal place?

469


What's a code group? : java security

530


Explain working of java virtual machine (jvm)?

511






What about products that claim to detect malicious applets? : java security

473


How does jpa repository work?

510


What is lambda value?

483


What is savepoint in java?

464


can anyone tell me what kind of questions are asked for core java exam in aptech

1454


What is a service layer in java?

413


Do I really have to type in the programs in the book to try them out?

583


What can open a jar file?

461


What is transaction management in java?

511


What are the types of cookies in java?

495