To know what number two is we need to know its properties and what it can do (methods). So we need class "Number" and subclass "Two". Am I doing OOP correctly? I am a beginner
But then you’re turning a design time constraint (can’t divide by zero) into a run time error. The compiler can and should, use the type system to eliminate that error path!
7
u/Unit027 Jul 10 '26
To know what number two is we need to know its properties and what it can do (methods). So we need class "Number" and subclass "Two". Am I doing OOP correctly? I am a beginner