Can constructor be private?
Answer / Ravinder Kumar
In Python, constructors (or special method __init__()) cannot be made private. However, you can define a private initializer using a double underscore name: `def __init__(self, ...): ...`. But it will still be accessible to subclasses and instances.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are python variables?
Why don’t python lambda have any statement?
How you can convert a number to a string?
How are inheritance and overriding methods are related?
What is list comprehension? Give an example.
What does unittest main () do?
What is flask used for in python?
Where can I learn python for free?
What does slicing mean in python?
What is “call by reference” in python?
What is keyword arguments in python?
Why main method is static?