Qus:    Can we make constructors static?
Feb 20, 2021 09:56 1 Answers Views: 512 JOSHUA
Prev Next
Answers (1)
SANJAY Feb 22, 2021 10:00
Answer:   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.

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.

Let`s Connect