 Hello everyone. Myself Prof. Preetish Chitte, working in Mechanical Engineering Department, in College-Walchand Institute of Technology-Solopur. Today we will discuss the third part of classes-objection methods. The learning outcomes are, the student will be able to construct Java source codes with the help of by taking the value from the user. And also the student will be able to develop Java transcript by combination of taking the value from the user and method and object declaration. These are the contents. First we will see the recap of the second session. After that we will see the program by taking the value from the user. And after that we will see the another program which will be the combination of by taking the value from the user. And also the applications of classes, objects and methods. Now first we will discuss the recap of the second session. Where we have discussed the get data method which consists of the variables length and width with the variables x and y with the data type integer where we had said that length is equal to x and width is equal to y. So this will be called as the get data method. And after that there is one more method which consists of the formula for the area of rectangle and which will be stored in the method rect area. Object declaration. Object declaration can be done with the help of following statements. Rectangle is our class name. Rect1 is an object name. New is an constructor. And again rectangle will be the class name. Here rectangle rect name is an declaration of an object. And rect1 is equal to new rectangle which will be called as initialization of an object. So this will be for rectangle 1. This statement is for the rectangle 1. Similarly we can write the statement for the rectangle 2. Similarly rectangle rect2 is equal to new rectangle where rectangle is a class name. Rect2 is an object name. New is a constructor. And rectangle is an again class name. The constructor new which will be combined the class name and object name. Here we can see the rect1 and rect2 are the object name for rectangle 1 and rectangle 2. The next part is the accessing the class members. Here accessing the class member means providing the value for the variables. The gate data method. We have discussed the gate data method. What is the use of the gate data method is that suppose we want to calculate the area for the two rectangles. Means here we can declare the values for the variables with the help of gate data method. Here the rect2. Here we are dealing with the rectangle 2. The gate data is an method. We are recalling the gate data method. 30 and 60 are the values for the variables. Here 30 and 60 are called as parameter list. What is the gate data method? Here that is called as recalling the method. That is the gate data method. This is the syntax for the gate data method. Here x is equal to 30. y is equal to 60. But we have declared that x is equal to length and y is equal to width. Method 2. Here the method 2 is also called as the gate data method. Where we can put the values here. The in general syntax will be the object name dot method name in the bracket parameter list. So rect2. gate data in the bracket 30, 60. Now suppose we want to calculate the area for the rectangle. Here we have recalled one method that is called as rect area method. Which consist of the length into width. That is the formula for the area. Now, the in general statement will be first we have to declare the variable for the area rectangle. So that is a2 is equal to object name dot method name that will be the in general statement. Object name is rect2 and method name is rect area. So whenever we are recalling the rect area method there will be the formula for the area of rectangle. We already know the values for the length and width so there will be the calculation for the area 2 for the rectangle. Very simple question. Why to use the gate data method? Why to use the gate data method? We just discuss now. Just think of it. Now today we will discuss the program regarding how to take the value from the user. Directly we will go to the program statement and we will discuss the program directly. So the program statement is that write the program to calculate gross salary of an employee. Consider the variable as a basic salary. Here we have to take the value from the user. These are the two conditions. If suppose the basic salary is less than 1500 there will be the house rent allowance will be the 10% of the basic salary and the dareness allowance will be the 90% of the basic salary. And the condition 2 is provided that if the b is greater than equal to 1500 then your house rent allowance is 500 and your dareness allowance will be directly 98% of the basic salary. Now we will move directly to the program. Now here we are using the scanner scanner method. Suppose you want to take the value from the user you have to use the scanner scanner method. There are actually three methods to calculate any output with the help of taking the value from the user. The first method that we are discussing and which is very simple which is called as scanner scanner method. The second method the second method is called as buffer string method. And third method is called as parse int method. But the scanner scanner method which is very simple than the buffer reader method and the parse int method. Now we will go directly to the program. Here import java.util.scanner. This will be the very first statement in the program. Whenever we want to take the value in the program the program will be starting with directly the user. But here we are providing the value from the user. Our first statement will be import java.util.scanner So scanner is a method. Here we are importing the value from the user. That's why import. Util consists of everything. Util consists of your classes, objects, method your values, variables, arrays, strings which is very important. Util is a package and here we have declared the GS as a class name. Public static wide man string ARGS is an main statement. Now this is very important. This will be your new statement. Scanner input is equal to new scanner in the bracket system.in So scanner input is equal to new scanner. So here input will be act as an object. Here the scanner scanner is a method new is a constructor. Here we are taking the value from the system. Now here we have declared the variables that is basic salary, house rent allowance and the gross salary. Here we have to calculate the gross salary. Here first we have to enter the enter the value of basic salary. So B is equal to input dot next double. So input is an object name. Next double is an data type that we have declared already. If suppose you want to declare the data type as an integer your statement will be input dot next int i capital. Here d is capital for the double. So whenever you want to type the value for the B here you can type the value for the B. Now if condition if B is less than 1500 there will be the some the conditions that we have discussed in the question. So house rent allowance is equal to Bx100 that is 10%, and thereness allowance equal to Bx90%. House rent allowance equals 500 and thereness allowance is equal to Bx90%. Now here there will be the calculation of the house rent allowance and the thereness allowance. And the gross salary and the calculation of the gross salary is equal to basic salary plus house rate allowance and thereness allowance. Here there will be of gross salary now this will be the program let's see the output now now the commands are javasyspace.js .java javaspace.js is a class name here we have to put the basic salary suppose I will put the basic salary 20,000 so these will be the values for the house rent allowance and the gross salary the gross salary will be 40,100 so this will be a very simple program with the help of by taking the value from the user now we will move to the next program now the another program statement is to calculate the roots of two quadratic equation by taking the value from the user and also by applications of object, method and declaration so this is the combination of by taking the value from the user and the object and method declaration now we will directly move to the program this is the program which is similar to the the program that we have discussed in the second part here the import java.util.scanner which will be there whenever we want to take the value from the user here there will be the use of get data method now we have to declare the values and the formula in the root 1 the formula for the root 2 here after that here the scanner scanner method eq1 and eq2 are the object name for the equation 1 and equation 2 here we have to print the values of a1, b1 and c1 with the help of eq.next double eq is another object name after that get data method we are recalling the get data method so x11 and x12 are the roots of the first equation and x21 and x22 are the roots for the second equation now we will move directly to the program and the output so java c space root.java java space root so we will put the values of a1, b1, c1 1, 9 and 1 there will be the roots for the equation 1 that is the root 1 and root 2 after that 2, 11 and 2 these are the values for a2, b2, c2 for the equation 2 and these will be the value for the root 2 for the equation 2 now these are the references thank you very much