1.

Answer the questions (i) to (iv) based on the following:(i) Which type of Inheritance is demonstrated in the above code?(ii) Explain Statement 1 and 2.(iii) Name the methods that are overridden along with their class name.(iv) Fill Blank 1 with a statement to display variable category of class Brand.

Answer»

(i) Multiple Inheritance

(ii) Statement 1 and 2 invoke the getSdata() function of class Shop and getData() function of class Brand respectively.

(iii) getdata() method of class Brand is overridden. When object of class Mall is created,

M = Mall()

M.getdata()

getdata() method of class Mall is invoked and not of class Brand is called.

(iv) print Brand().category



Discussion

No Comment Found

Related InterviewSolutions