Can we make constructors static?

DWQA QuestionsCategory: JavaCan we make constructors static?
Editor Staff asked 9 months ago

Can we make constructors static?

1 Answers
Editor Staff answered 9 months ago

As we know that the static context (method, block, or variable) belongs to the class, not the object. Since Constructors are invoked only when the object is created, there is no sense to make
the constructors static. However, if you try to do so, the compiler will show the compiler error.