 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can check whether the entered number is positive, negative or zero in Java. First of all, I am going to import a class which is declared in a util package. Name of class is scanner. After this statement, I am going to define the class for checking positive, negative or zero. Inside this class, I have to define main method. So this is the header of main method. Inside this definition, I have to provide logic so that I can check whether the number is positive, negative or zero. I have declared an integer variable that is int n. Now I am going to create instance of scanner class. Name of that instance is input and in constructor, I am passing system.in which will decide that we have to receive input from output screen or console. Now to display a message to user, I am using system.out.println. It will display the message enter a number on output screen to receive input from user. I am calling a method next int. This next int method is defined in scanner class. That's why I have created instance of scanner class whose name is input. After receiving input, I can check whether this input is positive, negative or zero. So I am implementing conditional statements here. First condition is n greater than zero. If this condition is true, then I can print number is positive. If this condition is false, then I can write else and another if which will check n less than zero. So this is for negative check. If this condition is true, then I can print number is negative. If both the conditions are false, then at last I can write system.out.println number is zero. This way I have checked all three conditions for positive, negative and zero. So this is the complete code which will check whether the entered number is positive, negative or zero. Now I have to save this program. So I am going to d drive. Inside d drive, I have created a folder Java. Inside this folder, I am going to save this file with this name and with .java extension. So my program is saved in a folder. Now I have to execute the program. Before that I have to compile it. So I am opening command prompt. Here I have to move to d drive and inside d drive I have to move into Java folder. Here I am typing dir so that you can see the directory. You can see here total five files are available. Even or .class, even or .java. It is a separate program. Some.class, some.java. It is a separate program. You can see POS, energy, ZRO. This file is available with .java extension, but its .class file is not available. So .class file represents byte code. It is created just after the compilation of the code. So until now we have only implemented the code. We have not compiled it. So now I am going to compile it for you. You can see the code is compiled successfully. No error has been displayed here. Now again I am going to display the directory structure. This time you can see byte code is also created with .class. So now I have to run this code which is byte code. You can see it is asking for a number. I am going to enter five. It is displaying number is positive. So it is working properly. I am going to again execute byte code. This time I am entering minus nine zero. You can see it is showing number is negative. Again I am going to execute byte code. This time I am entering zero. You can see it is showing number is zero. So in all cases program is working properly. So I hope you have understood how we can check whether the enter number is positive, negative, or zero with the help of flsladder in java. If you want to watch more programming related videos you can follow me on YouTube by subscribing my YouTube channel. Thank you for watching this video.