1 -please tell me how to understand oops concept .
Unable to understand what sir is teaching in oops
@amankat,
The main aim of OOPS is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.
We create a class ‘Person’. Person has 2 properties ‘Name’ and ‘Age’.
Now what we do is we create an object of class person using Person p1 = new Person(). Here p1 is the object name and new is the keyword which is used to create classes.
You may want to remember how we make the scanner object:
Scanner s = new Scanner(System.in);
Here Scanner is the class, and ‘s’ is the object that we create of the scanner class. You can ingnore System.in for now if you don’t understand, you will understand that in the next OOPS videos.
Now we have created a person class object ‘p1’ in the class PersonClient.
Now as soon as we execute this statement: Person p1 = new Person(), an object is created and it has 2 properties name and age. We can access name in that particular object by p1.Name and age by p1.Age.
Now we can also change the values of p1.Name or p1.Age by doing p1.Name = ‘abc’ and p1.Age = ‘100’.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.