I am studying servlets I read that servlets are java programs but there are no constructor in servlet…
Can anybody elaborate on it?
I am studying servlets I read that servlets are java programs but there are
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are as in any other java class, but you don’t need to invoke it. The webcontainer will call it for you.
Most servlets do not hold instance data, hence, most of adding code in the constructor doesn’t make any sense.