 Hello friends, I am Sanjay Gupta. I welcome you on my channel. If you like this video, you can share or subscribe my YouTube channel. In this video, I am going to demonstrate a program which will be based in Java. Title of the program is compare two numbers and find out maximum. Here you can see I have already implemented some instructions in which first is importing a class that is scanner. This class is available in utl-package. So if if you want to read some values from user, then we require this scanner class instance. Then I have declared another class whose name is numbered. Inside this number class, I am going to define main function definition. So first of all, I am going to declare two variables n1 and n2. Then I am going to create instance of scanner class and in constructor, I am passing system.in. System.in means all the inputs will be received from the console. Now to print a particular message on output screen, I am using system.out.print talent. This will print the message enter first number on output screen. Now I am going to receive that number in n1 variable using this input instance with the help of next int method. This next int method is already defined in scanner class. Now to read second number, I have copied these line number 9 and 10. I am changing the statement enter second number and the entered number will be stored inside n2. So you can see first number will be stored inside n1 and second number will be stored inside n2. Now after completion of reading, we have to compare these two numbers. For that purpose, I am using if condition. Here you can see I have compared n1 with n2. So if n1 is greater than n2, then I can print on output screen. First number is greater. So if this condition is true, then this message will be displayed on output screen. Else if n2 is greater than n1, then for this if condition, message will be second number is greater. And third case will be it might be possible that n1 and n2 both are equal. So in third case, I can print both numbers are equal. So this way total three scenarios are implemented with the help of FL statement. I hope you have understood how I have implemented these instructions in front of you. I have already saved this program with calculator.java. So I am changing this name of class as calculator because whenever the compiler code bytecode will be generated with the name of class. So I am using calculator instead of a number. Now moving on command prompt, I have saved this program in d drive. So I am moving to d drive. Inside d drive, I have a folder java. Inside java folder, this calculator dot java is available. So first I am going to compile this code. If any error will be there, it will be displayed. You can see it is not showing any error. It means code is compiled properly. Now I can execute this code. So I am writing java space calculator. So you can see it is asking for first number. I am entering 10. It is asking for second number. I am entering 20. You can see the output. It is showing second number is greater. So I hope you have understood the output. Once again, I am executing this code. So if you want to run your code second time, then you can compile it again and again. You can simply execute the bytecode which you have generated. So this time I am entering both the number as 30. You can see the output. It is showing both numbers are equal. So this way I have implemented the code which is comparing and it is showing a particular number which is greater or it is showing better. I hope you have understood the concept well. If you want to watch more programming related videos, you can search my YouTube channel. Thank you for watching this video.