00:01
Hello students we are given in the question right java program there's swap between two integers we need to find user must input the numbers and print the two numbers after swapping right so what is basically number swapping if we're gonna write here what is number swapping? so number swapping is if user put input as like number three to if i write number five two then answer in the output would be output would be output would be to five.
00:33
So numbers are swept right so now let us come to our java program java program right for swapping two numbers right so let's start with our first we need to import import java.
00:54
Util library java .utel star right and we need to make to make we are going to make our class with name swap underscore numbers and we need to start our class with curly bracket now what we are going to do is we just need to declare or define our variables but before that we need to write our function which is public static void main in the particular class public static void main function with string a rgs string a rgs and we it started with curly bracket so we need to close that and let's start with our curly bracket right here so now we need to declare all the variables so we we can write inter -data type variables as a, b and tamp 3 variable which here we can write here a and b are the numbers to be swept and temp is temporary variable.
02:27
And temp is temporary variable.
02:40
So now what we gonna do? is we need to write our temporary variable.
02:46
We need to scan the values according to that and solve.
02:49
So now let us start.
02:51
So here, semicolum would be there.
02:54
Now we are going to write our next instruction next step.
02:59
So what we need to do is we need to declare a variable for scanning.
03:07
So we can write rd as variable right here is equal to new is equal to new scanner system dot in system dot in right now now we need to print message here system dot out dot print l and we need to display a message enter enter the enter the value of a and b right so now in the next step we need to read very we need to read a and b values from the user so a is equal to rd dot rt dot next rt d into because data type is in and b is equal to rd dot next rd dot next end.
04:13
So these values are read by user...