 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can calculate simple interest in Java. So first of all, we have to import a class scanner. This class is already declared in Utile Package. After importing scanner class, I am going to define another class whose name is SI, that is simple interest. Inside this class, I am going to define main method. Inside main method, I am going to implement the logic to calculate simple interest. So I am going to declare float variables P for principle, R for rate, T for time and SI for storing calculated simple interest. Now I am going to create instance of scanner class that is input and its constructor I am passing system.in. System.in is responsible for receiving input from console. Now to print masses on output screen, I am using system.out.print ln. So it will print the masses and the principle rate and time. Now to receive these values, I am going to call a method that is next float because these variables are float type. That's why I am calling next float method. This method is already available in scanner class and this input is the instance of scanner class. That's why I am calling next float using input. So principle amount will be stored inside P. Then R will be storing rate. So again I am calling next float and T. So this way principle rate and time will be stored inside these variables. Now I can calculate simple interest. So I am applying this formula P into R into T upon 100. So calculated simple interest will be stored inside SI variable. Now I can easily print this calculated value on output screen. So this way with the help of system.out.print ln, the masses simple interest equals to and the value which is available inside SI variable will be displayed on output screen. For separation I have used plus in C programming we use comma and in Java we use plus for separating text and variables. So this code is already saved with SI dot Java name. This file is available in D drive inside Java folder. So now I am going to open command prompt inside command prompt. I am moving to D drive and inside Java folder. Now I am going to compile this code for compilation. I am typing Java C space SI dot Java. So if there are any errors compiler will show those errors if code is error free then you can type command for executing the byte code which is generated after compilation. So I am typing Java space SI. You can see it is asking for principal rate and time. So I am entering 10000 as principal amount, rate of interest 10% and time 3 years. You can see the output it is showing 3000. So if principal amount is 10000 rate of interest is 10% and time is 3 years. Then simple interest will be 3000 rupees. So this way I have calculated simple interest 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.