can v create a constructor 4 servlet?

Answer Posted / sanjay sah

Yes, we can create constructor for servlet but that one
should be public no-args constructor.
If we do not create then compiler itself takes care for
it.Servlet container creates instance of servlet by invoking
public no-agrs constructor.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is context in servlet?

533


What's the servlet interface?

591


What are the different methods involved in the process of session management in servlets?

659


The code in a finally clause will never fail to execute, right?

595


What is preinitialization of a servlet?

578






request parameter how to find whether a parameter exists in the request object?

564


Can we get PrintWriter and ServletOutputStream both in a servlet?

648


What is the difference between the http servlet and generic servlet?

597


Define the servlet mapping.

544


Explain the servlet context.

594


What is servlet container. how it works?

603


What is the servlet?

614


Explain the lifecycle of a servlet?

498


What is difference between cookies and httpsession?

543


What are the common methods that are included in the http servlet class?

574