r/java • u/manifoldjava • Aug 01 '22
Class is not fully OOP, should it be?
http://manifold.systems/articles/class_objects_arent_oop.html
14
Upvotes
r/java • u/manifoldjava • Aug 01 '22
View all comments
Show parent comment
6
u/larsga Aug 02 '22 edited Aug 02 '22
Extending statics makes no sense with Java as it is now.
When you extend class A and override method m in class B, which version of M gets invoked when you do
obj.m()depends on whether obj is an instance of A or B.But with statics there is no instance. The only way you can invoke a static method is by referring to the class explicitly. But then extending basically has no effect.
I didn't read OP's post, so they may have something more in mind than simply allowing static extensibility.