Can we replace the pupose of init method to the servlet constructor?
My question is why does servlet need a separate method int(ServletConfig config) for the pupose of initialization we could have achieve the same thing by having a parameterised constructor let XServlet(ServletConfig config) and the container can invoke the same .
Can we replace the pupose of init method to the servlet constructor? My question
Share
Probably because you cannot specify the parameter signature for constructors in an interface.