Results 1 to 3 of 3

Thread: HttpServlet abstract class

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Answers
    3

    HttpServlet abstract class

    1) HttpServlet doesn't have any Abstract methods but we can say that HttpServlet is an Abstract Class,How?

    2) Could you tell me is there any classes of this type in both J2SE and J2EE?


  2. #2
    Banned
    Join Date
    Jan 2008
    Answers
    25

    Re: HttpServlet abstract class

    Hi chandra,
    we can declare a class as abstract even though if it contains all concrete methods(with implementaitons). like
    public abstract class Test{
    }
    or
    public abstract class Test{
    public void m1(){}
    }

    Similarly HttpServelt is also has all implemented methods but they do nothing(like in out eg.
    If it is non-abstract when it is instatiate it, it is like do nothing servlet.
    That is the reason why it had make abstract so that the actual functionality is implemented in child class which is extending that HttpServlet class.

    Thanks & Regards,
    --Suresh--


  3. #3

    Re: HttpServlet abstract class

    one more example of abstract class without any abstract method(s),other than HttpServlet existed in J2SE i.e.
    public abstract class Component as java.awt.Component;
    No method of Component class is abstract


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact