Exam PCAP All QuestionsBrowse all questions from this exam
Question 66

If any of a class's components has a name that starts with two underscores (___), then:

    Correct Answer: A

    If any of a class's components has a name that starts with two underscores (___), then the class component's name will be mangled. This means that the interpreter modifies the variable name to include the class name, making it harder to create subclasses that accidentally override the private attributes and methods. This name mangling is done to avoid naming conflicts in subclasses.

Discussion
AdeshinaOption: A

A the double underscore (__) prefix is used to denote so-called "private" class members, i.e. class attributes or methods that are intended to be used only within the class or its subclasses, and should not be accessed directly from outside the class. When a class member is given a double underscore prefix, the interpreter automatically mangles the name of the member by adding a prefix and a suffix to it. This is done to prevent name clashes between class members with the same name but defined in different classes.

Janpcap123Option: A

Absolutely A is the answer.

macxszOption: A

A. the class component's name will be mangled

AlMargoiOption: A

I think answer is A