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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.