Should a servlet explicitly return at the end of doGet/doPost?

java, return, servlets

Solution

No. As a regular `void` method, it does not require a `return`

Problem

Is there any difference between explicitly returning at the end of doGet or doPost-methods, and just letting the method return "by itself"? ``` public void doGet(HttpSerlvetRequest req, HttpServletResponse resp) { <my code here> return; } public void doGet(HttpSerlvetRequest req, HttpServletResponse resp) { <my code here> } ```

Original source