 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can calculate area and parameter of rectangle in Java. First of all, I am going to import scanner class that is available in util package. This scanner class is predefined and it is required to read inputs from the user. Then I am going to define another class whose name is rectangle. Inside this rectangle class, I am going to define main method. So inside this main method, I am going to implement the logic which will calculate area and parameter of rectangle. So I am declaring float variables, length, breadth, A for area and P for parameter. Now I am going to create instance of scanner class and passing system.in as constructor value. System.in means all the inputs will be received from command prompt or you can say console. So first system.out.println will display enter length. So length will be received in L variable using next float method. This is a predefined method which is available in scanner class. Now to read breadth, I have copied these two statements and I have modified enter length to enter breadth and in place of L variable, I am using B. So after reading length and breadth, I can calculate area and parameter. So for calculating area L into B for calculating parameter 2 into L plus B. So this way I have implemented both the logics for calculating area and parameter. Now I have to display these calculated results on output screen. So I am using system.out.println area equals to plus A. So area equals to will be displayed as it is and this A will be printing its value. I am copying this statement again and this area will be converted into parameter and instead of A, I am using B. So this way I have implemented the complete code in front of you which will calculate area and parameter of rectangle. I have saved this file with rectangle.java name and it is saved in D drive inside Java folder. So now I have to open command prompt so that I can show execution of this code. Here I am moving into D drive and inside Java folder. Now first I have to compile this code. So I am typing java scene space rectangle.java. It is compiled successfully. There is no error in the code. Now I can execute this code with the help of java space name of class that is rectangle. It is asking for length. I am entering 4. It is asking for breadth. I am entering 5. You can see the output. Area and parameter both are calculated and both are printed on output screen properly. So this way I have implemented the logic which is calculating area and parameter of rectangle in Java. I hope you have understood whatever I have explained in this video. If you want to watch more programming related videos you can subscribe my YouTube channel. Thank you for watching this video.