WEBVTT 00:02.270 --> 00:09.650 One of the major benefits of object oriented programming is the reuse of code and one way to achieve 00:09.650 --> 00:18.690 it is inheritance inheritance can be best explained as creating a new class based on the existing class. 00:18.770 --> 00:28.310 The new class is called tribe class or child class and the other class is core base class or Parent 00:28.310 --> 00:29.440 PLUS. 00:29.790 --> 00:32.000 Let's see how to perform inheritance. 00:38.300 --> 00:39.410 We'll create a class 00:42.560 --> 00:42.980 person 00:49.990 --> 00:52.830 define them in the method. 01:19.920 --> 01:30.770 And will define another method or name which will only well 01:44.820 --> 01:48.150 create another class which will be over a child. 01:48.150 --> 02:02.440 Class C student note from an inheritance we pass this this class to the child class like this. 02:05.770 --> 02:11.950 And we create the net method of this child class. 02:22.650 --> 02:34.300 No as we're creating in it method into the child class we need to explicitly call the init matter of 02:34.300 --> 02:37.580 the parent class. 02:37.630 --> 02:39.300 We didn't see a person 02:41.910 --> 02:42.260 God 02:50.110 --> 02:59.150 loves and if there is no one implemented in the child class then Burton will call the init mental of 02:59.150 --> 03:01.450 the parent class automatically 03:05.610 --> 03:12.340 intrusive so the student body is equal to the Student A 03:19.200 --> 03:25.180 and create another method. 03:32.170 --> 03:35.330 Now we'll see sir. 03:39.980 --> 03:43.660 This is the benefit of inheritance. 03:43.680 --> 03:47.940 Notice that we haven't defined the name in a student. 03:47.940 --> 03:56.590 We are inheriting it from the parent class person so this will return the full name of the student. 04:18.270 --> 04:20.450 No. 04:22.000 --> 04:23.690 The object of these classes 04:34.460 --> 04:34.880 say 04:38.490 --> 04:39.450 we'll call 04:50.040 --> 04:51.620 the student 80 04:55.820 --> 05:02.020 now as we have written return method here. 05:02.220 --> 05:04.890 We'll see. 05:04.890 --> 05:10.250 Brent dot named 05:13.230 --> 05:18.010 rim B Dot. 05:18.900 --> 05:19.500 Student 05:24.870 --> 05:25.840 in this program. 05:38.200 --> 05:38.610 The 05:49.210 --> 05:49.610 execute 06:00.170 --> 06:03.060 that whole inheritance is performing better. 06:06.230 --> 06:12.540 You can create as many child classes as you want. 06:12.620 --> 06:15.680 Drive from this better class person.