24th Mar 2018, 9:24 AM
Hethal
Hethal - avatar
6 Respostas
+ 2
class B inherits the method from class A class C inherits 2 methods (method and another_method) from B so you can call any of the three method on the same object of class C
24th Mar 2018, 10:53 AM
michal
+ 2
@vaishanvi patil thanks so your calling the method
24th Mar 2018, 11:41 AM
Hethal
Hethal - avatar
+ 2
at the last four lines you: create an object of class C invoke "method" on that object (you can do this because class C inherited it from A) invoke another_method on that object (class C inherited it from B) invoke third_method on that object (its class C's own method)
24th Mar 2018, 2:24 PM
michal
+ 1
@michal I understand that part what I don't understand are the last four lines
24th Mar 2018, 11:17 AM
Hethal
Hethal - avatar
0
Inheritance concept, parent methods properties available by default to children classes and using last four line we are accessing methods from parents
24th Mar 2018, 11:40 AM
Vaishanvi Patil
Vaishanvi Patil - avatar
0
In line 13 a variable c is identified to equal the class c “c = C()” Now since you understand what is before that, you know that class C inherited from class B and class B inherited from class A Since line 13 connected variable c to class C, now variable c is connected to all Classes, which is tested in line 14-16
17th Apr 2018, 12:16 AM
Mohamed El-Sayed
Mohamed El-Sayed - avatar