+ 1
Why constructors in java can't be static? Any explanation please?
4 Réponses
+ 3
Adding to what ~ swim ~ has mentioned.
A static method is not inherited by the subclass but a constructor at times might require to call the constructor of base class. If it is static then you cannot do that.
+ 2
I think I get it now.
Constructors are executed when an OBJECT is created. It is not like a method that you can call.
+ 1
Maybe this will help:
https://www.sololearn.com/learn/Java/2157/?ref=app