Certified Associate in Python Programming (PCAP) — Question 129
A class constructor (Choose two.)
Answer options
- A. can return a value
- B. cannot be invoked directly from inside the class
- C. can be invoked directly from any of the subclasses
- D. can be invoked directly from any of the superclasses
Correct answer: B, C
Explanation
Option B is correct because a constructor cannot be called directly from within its own class, as it is automatically invoked when an object is created. Option C is also correct since constructors can be called from subclasses to initialize inherited properties. The other options are incorrect; constructors do not return values (A), and they cannot be invoked directly from superclasses (D).