For example in this method : protected void doPost(HttpServletRequest req,HttpServletResponse resp)throws ServletException,java.io.IOException {} 
throw new ServletException,java.io.IOException ; is not being used in the method definition . why is that ? can anyone please tell me why? I'm new to java .
in the below code throw is used and why is it not used in the above method which throws exception.
  class SomeClassName { 
        void show() throws Exception
           {
            throw new Exception();
            }
         }
 
     
     
    