Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Below is an example of shadowing a parent method in a child class.
Struct in Rust
Use a Class in the Definition of the Class in Python
Comments¶
- As long as the class name is not need at definition time of the class, it is OK to use it.
You cannot use a class in default values of the __init__
function of the class.
Class in Python
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
@abstractmethod, @staticmethod, abstract class, etc.
override,
prefer classmethod to static method;
both class and static methods can be override
Meta Class
https://stackoverflow.com/questions/100003/what-are-metaclasses-in-python
It seems to me …
Object Oriented Programming in Java
Tips and Traps¶
A static method cannot be abstract in Java. For refer to this discussion on Stackoverflow for rationale behind it. If you need the two together, what you are looking is probably singleton object with inheritance.
Singleton objects are more flexible and useful than static methods in Java. Please refer to Singleton Pattern Versus Static Class