I have seen in many servlets that doPost and doGet are declared public or protected.
What is the purpose of declaring a doPost or doGet as protected?
Thank you.

it basically decides who can access the method.
public -> everyone
protected -> package level and subclasses