1.

Private members of a class cannot be accessed.(a) True(b) FalseThis question was addressed to me by my college professor while I was bunking the class.Asked question is from Encapsulation topic in section Classes and Objects, Inheritance, Polymorphism, Encapsulation and Exception Handling of Python

Answer»

Correct OPTION is (b) False

Easiest explanation - Private members of a class are accessible if written as follows: obj._Classname__privatemember. Such renaming of IDENTIFIERS is CALLED as name MANGLING.



Discussion

No Comment Found

Related InterviewSolutions