1.

The purpose of name mangling is to avoid unintentional access of private class members.(a) True(b) FalseThe question was posed to me in an interview.My doubt stems from Encapsulation in chapter Classes and Objects, Inheritance, Polymorphism, Encapsulation and Exception Handling of Python

Answer»

Correct choice is (a) True

Best explanation: NAME mangling prevents unintentional access of private members of a CLASS, while STILL allowing access when NEEDED. Unless the variable is accessed with its MANGLED name, it will not be found.



Discussion

No Comment Found

Related InterviewSolutions