Can you use constructor in servlet?

1 answer

Answer

1251230

2026-08-08 10:55

+ Follow

Java
Java

Yes you can but it is not required. A Servlet is nothing but another .Java file and all rules that are applicable to standard Java classes are applicable to them.

Note: Even if you write a constructor in a servlet, it will not get executed.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.