Why there are no constructors in servlets?
Answers
Answered by
0
Servlet implementation classes can have constructor but they should be using init() method to initialize Servletbecause of two reasons, first you cannot declare constructors on interface in Java, which means you cannot enforce this requirement to any class which implements Servletinterface and second, Servlet require
Answered by
0
Answer:
The parameterized constructors are the constructors having a specific number of arguments to be passed. The purpose of a parameterized constructor is to assign user-wanted specific values to the ins.tance variables of different objects. A parameterized constructor is written explicitly by a programmer.
Similar questions