Extending Abstract Classes & Program Entry Point

I have the following classes:
CopServlet - which extends PercServlet
PercServlet - abstract class which extends HttpServlet
HttpServlet is the base class. I'm using Visual Age with a web.xml file that points to CopSerlet as the controller servlet. So my question is... When CopServlet gets called, where is my program entry point? My CopServlet class does NOT have a main method.

When CopServlet gets loaded, its init() method is called. And when it is called via an HTTP request, either its doGet() or its doPost() method is called, depending on whether it was a GET or a POST request. That's how servlets work. The business about abstract classes is irrelevant to that.

Similar Messages

  • SAPScript Print Program Entry Point

    Dear all,
      I try to modify the standard SAPScript form and its related print program.  What is the program entry point for those associated print program??  Since, i want to add my own logic and don't know where should i start.  I can only find the subroutine FORM_OPEN and ENTRY.
    Regards,
    Kit

    hi,
    u can add u r logic by using form routines.
    FORM .. ENDFORM is used when retrieved data
    needs to sent back to print program.
    In SAPscript:
    PERFORM < routine_name> in <report_name>
                USING  &var1&
            CHANGING &var2&.
    ENDPERFORM.
    in case of reports,
    i am giving the sample example for this,
    FORM < routine_name> in_tab type ITCSY
                                out_tab type ITCSY
    READ TABLE in_tab WITH KEY NAME = ‘var1’.
    {Data Selection based on above value. It returns ret_value.}
    READ TABLE out_tab WITH KEY name = ‘var2’.
                out_tab-value = ret_value.
                MODIFY out_tab.
    ENDFORM.
    Reward points if useful,
    Thanks,
    usha

  • Can interface extend abstract class?

    Can interface extend abstract class?
    I tried to make a interface extend an abstract class but i got an error stating:
    interface expected here.
    Can anyone help me ?

    > ok, but can an interface implement an abstract class?
    No. An interface provides no implementation whatsoever. An abstract class can implement an interface, but not the other way around.
    http://java.sun.com/docs/books/tutorial/java/concepts/interface.html
    ~

  • Extending abstract classes

    I just have a simple question. I have one class which is abstract
    public abstract class Person
         private String firstName;
         private String lastName;
         private String title;
         private String dateOfBirth;
         private String homeAddress;
         private String phoneNumber;
         public static final String MR = "Mr";
         public static final String MISS = "Miss";
         public static final String MS = "Ms";
         public static final String MRS = "Mrs";
         public static final String DR = "DR";
         public static final String PROF = "Prof";
         public Person(String firstName, String lastName, String title, String dateOfBirth,
                         String homeAddress, String phoneNumber){
              this.firstName=firstName;
              this.lastName=lastName;
              this.title=title;
              this.dateOfBirth=dateOfBirth;
              this.homeAddress=homeAddress;
              this.phoneNumber=phoneNumber;
         And i have another class which extends this class
    public abstract class Borrower extends Person{
      public LibraryItem [] itemsBorrowed;
      private double currentFine;
      private int barCode;
      public LibraryItem [] getItemsBorrowed()
           return itemsBorrowed;
      public double getCurrentFine()
           return currentFine;
      public int getBarCode()
           return barCode;
      }When i try to compile these two classes, i get the error
    Cannot find symbal constructor Person(). The problem is that the tutor hates us providing default constructors, and i presume that this is what the error is asking for. Is there any way around this or does a default constructor need to be povided?
    cheers

    codingMonkey wrote:
    georgemc wrote:
    nick2price wrote:
    Ok, i get you, better call the superclass constructor as tutor hates me using no param constructorsChallenge him on that. Not only are they perfectly acceptable, they're a mandatory part of the JavaBeans spec.Personally, even though there are nothing wrong with them, I prefer to avoid no-arg constructors in a lot of cases. Usually when I feel that a class should always have certain attributes. I.e. instead of having a no-arg constructor for something like a Person class, I'd rather have a constructor that takes at least a name. It is true that the name could always be initialized in the no-arg constructor, but I would think that it makes more sense for a person to always have a name, rather than being called "null" or "N/A".If you plan on using any framework that uses the Beans spec (and while the inexperienced, self-professed "purist" might balk at that, you'll find it virtually impossible to avoid as a commercial coder) you won't be able to with those classes. Your argument about always needing a sensible starting point falls down where you have multiple disparate types that you are re-constructing. While it's quite nice to say "a Person should always have a Name", if you have, for example, a persistence framework that will generically map the results of various database queries back onto Java objects, you have to write some special case code for each class in your domain model, that says "in order to contruct this object, you first need to perform this query, then invoke this constructor with this part of the result of that query, then populate the rest of the properties using setter methods". For every class in your domain model. That's a fair amount of overhead. The no-args constructor model completely circumvents that, since everything's populated by the same generic code - beans introspection. Think about it. For every class in your model, you have to have separate chunks of code that are aware of - and hence, coupled to - a specific query, and a specific constructor of a specific class. Far from ideal.
    Even if you decide to roll your own code to manage peristence, configuration, remoting and the like, you'll still eventually settle on no-args constructors as extremely handy tools. Note that I'm all for the presence of other constructors as well, that do allow sensible creation of objects with certain values. Just that the no-args constructor is so infinitely useful for writing a huge amount of generic code
    I would think that it makes more sense for a person to always have a name, rather than being called "null" or "N/A".Me too. And there's nothing in any of my points that gainsays, or opposes that. You create a Person instance, and he's called "null" for a few clock cycles before you populate him from a database query - nothing wrong with that

  • Extend abstract class & implement interface, different return type methods

    abstract class X
    public abstract String method();
    interface Y
    public void method();
    class Z extends X implements Y
      // Compiler error, If I don't implement both methods
      // If I implement only one method, compiler error is thrown for not
      // implementing another method
      // If I implement both the methods,duplicate method error is thrown by 
      //compiler
    The same problem can occur if both methods throw different checked exceptions,or if access modifiers are different..etc
    I'm preparing for SCJP, So just had this weired thought. Please let me know
    if there is a way to solve this.

    Nothing you can do about it except for changing the design.
    Kaj

  • Extending abstract classes such as ByteBuffer?

    How would I extend an abstract class such as ByteBuffer?
    If I call the normal extends key word:
    public class MyBuffer extends ByteBuffer
    then I need to implement virtually every method in the class.
    But If I just create a ByteBuffer such as:
    ByteBuffer buf = BtyeBuffer.Allocate(100);
    then I can just go and use all of the various methods witin the class without have to implement anything.
    But I need to add an additional method to ByteBuffer . What is the best way to do this? I realize I can encapsulate a ByteBuffer object but that does not sound like a good idea.
    Is there a better way? If so what?

    Thanks. Well that gets me started.
    I have:
    public abstract class SerialPortBuffer extends ByteBuffer {
    and I am getting:
    Implicit super constructor ByteBuffer() is undefined for default constructor. Must define an explicit constructor     
    How do I fix this? Sorry for the newbie questions.

  • Extending Abstract Classes such I ByteBuffer?

    Sorry for the cross post but I think I posted this in the wrong forum origanally.
    I need to extend ByteBuffer so I did so like this:
    public abstract class SerialPortBuffer extends ByteBuffer {
    but now I am getting:
    Implicit super constructor ByteBuffer() is undefined for default constructor. Must define an explicit constructor
    How do I fix this? Sorry for the newbie questions and the goof on the cross post.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    But I dodnot think defining a no args constructor explicitly would remove the problem, since the no args constructor is still undefined in the super class. You need to define a constructor woth some arguments
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    public abstract class SerialPortBuffer extends ByteBuffer {
         * @param arg0
         * @param arg1
         * @param arg2
         * @param arg3
         SerialPortBuffer(int arg0, int arg1, int arg2, int arg3) {
              super(arg0, arg1, arg2, arg3);
              // TODO Auto-generated constructor stub
    When I try this I get.
    The constructor ByteBuffer(int, int, int, int) is not visibe
    Can anyone tell me how to extend ByteBuffer?

  • Abstract class with set and get methods

    hi
    how to write set and get methods(plain methods) in an abstartc class
    ex: setUsername(String)
    String getUsername()
    and one class is extending this abstract class and same methods existing in that sub class also..... how to write......plz provide some ideas
    am new to programming....
    asap
    thnx in advance

    yes... as i told u.... i am new to coding......
    and my problem is ..... i have 2 classes one is abstract class without abstract methods.. and another class is extending abstract class.....
    in abstract class i have 2 methods...one is setusername(string) and getusername() ..... how to write these two methods.... in abstract class i have private variables username...... when user logins ..... i need to catch the user name and i need to validate with my oracle database and i need to identify the role of that user and based on role of that user i need to direct him to appropriate jsp page.......
    for that now i am writing business process classes..... the above mentioned two classes are from business process.....
    could u help me now
    thnx in advance

  • Weird Abstract Class Question

    First off, I hope I'm posting in the correct section of the forum, apologies if I'm not.
    I have a bit a of a weird query more so than a question.
    I have recently been given the challenge of developing a mobile application. So as one does when one gets a job, they sit down and have a think about how to best use Java inheritance to make my their design nice and neat.
    So anyway to do some of the GPS stuff for my app I am using the JSF-179, an API specification for location info. So this JSF API is implemented by a number of providers, nokia, samsung, sony ericsson, etc..
    So as all implementations stick to the API, the code should remain the same for each platform, the only change will be where the code is imported from.
    So for example each class will have:
    import com.nokia.jsf-179
    import com.sony.jsf-179
    import com.samsung.jsf-179And this import info will be the only code that will change.
    I had a number of ideas:
    1 - Create an Interface with methods each concrete class can implement, but with this approach a code re-write is required. Also each sub class will conform to the java is-a rule so it really should extend an abstract class as opposed to implement an Interface.
    2 - Extend Abstract class, we still have the code re-write issue.
    So how then do I keep the code the same but only change the import info all nice and neat like? Is there some kind of abstract marker for imports?

    kajbj wrote:
    @Op. I don't know if you question is more of a design question, or if you have a question that is related to Java ME, or development on mobile phones. I'm however moving this thread from the Generics forum (since the question isn't related to Generics).given that [Joahim's answer|http://forums.sun.com/thread.jspa?messageID=10806927#10806927] satisfied OP, this topic better matches Java ME than design. Suggest to move it to CLDC and MIDP forum for closer toipic alignment

  • Good programming practice - Abstract class

    Hi all,
    I have been trying to help another soul in this forum, and came to the conclusion that I don't know good
    programming practice when it comes to abstract classes.
    Is this correct?
    You CAN implement methods in an abstract class, but it's not recommended.
    I have NEVER done this...when is there possibly a need to?
    Regards.
    / k

    Yes, absolutely, you can implement methods in an abstract class. Any method that all subclasses will perform in the same way can be implemented in the abstract base class. If subclasses perform similiar functions depending on their type you declare those as abstract in the base class. Here is a contrived example that I have seen on job interviews.
    Suppose your developing an application that draws on a panel. We want to provide some canned shapes such as a circle, a square and a triangle. We want to be able to draw the shape set or get its color and calculate its area.
    Let's define an abstract base class Shape
    public abstract class Shape{
        private Color myColor;
       //  since color has nothing to do with what kind of shape we're working with, create concrete implementation
       public Color getColor(){
            return myColor;
    public void setColor(Color newColor){
       myColor = newColor;
    // however, drawing the shape and calculation its area are depending on the actual shape.
    public abstract void draw();
    public abstract double getArea();
    // so then Square would be something like
    public class Square extends Shape{
       public double get Area()
          return sideLength * sideLength  // assumes somehow we know sideLength
    public void draw(){
                  // concrete implementation
    }we can do the same things for Circle class and Triangle class.
    And, if you think about it you'll notice that we could have made a Rectangle class and then Square would be a subclass of Rectangle where both dimensions are equal.
    I hope that somewhat strained example helps answer your question.
    DB

  • The procedure entry point ADAdPolicyEngine_DidEnterStation could not be located in the dynamic link library C:Program Files/x86/itunes.dll.

    I'd download the latest ITunes and I started it and it has this error message:
    "The procedure entry point ADAdPolicyEngine_DidEnterStation could not be located in the dynamic link library C:Program Files/x86/itunes.dll"
    I reinstalled ITunes several times and it got the same message. Please help.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    I've not seen this message before, but it has the same pattern as those discussed in the first and third boxes, suggesting that you've got an outdated .dll file that needs replacing. You should find iTunes.dll in the iTunes folder in Program Files or Program Files (x86). Delete it and then repair iTunes from the control panel. If that doesn't work go for the full tear down and rebuild.
    tt2

  • Abstract class extends other class?

    What happens when a abstract class extends other class?
    How can we use the abstract class late in other class?
    Why do we need an abstract class that extends other class?
    for example:-
    public abstract class ABC extends EFG {
    public class EFG{
    private String name="";
    private int rollno="";
    private void setName(int name)
    this.name=name;
    private String getName()
    return this.name;
    }

    shafiur wrote:
    What happens when a abstract class extends other class?Nothing special. You have defined an abstract class.
    How can we use the abstract class late in other class?Define "Late". What "other class"?
    Why do we need an abstract class that extends other class?Because it can be useful to define one.

  • Flash Player use to execute the main class entry point before rendering. Now it does not

    Adobe Flash Player use to execute the main class entry point before rendering the first frame. Now using the latest browsers and Flash Player 11.8 (11.8.800.94, or 11.8.800.97 for Chrome).
    With one of our swf apps, there are visual display objects on the first frame of the timeline. When the main class constructor is executed, those display objects are set to visible = false. So previously those display objects were never displayed because the first frame did not render until after the main class code was ran.
    Now when we browse to the our website, we find that those display objects are visible for a split moment of time (such as a quarter of a second).
    It appears that this may be a bug. We are wondering this could be new behavior based on loading/unloading the swf to optimize CPU usage and that Flash Player is taking a snapshot of the internal state of the first frame and displaying the cached snapshot before it actually loads.
    So...Chris (or other Adobe representative), is Flash Player supposed to be rendering the display before any code executes it runs the main class?

    Not that I'm aware of.  If this is something that just started with 11.8, then we could be running into some sort of bug injection.  Could you please open a new bug report on this over at bugbase.adobe.com?  When adding the bug, please include sample code, application or URL so we can quickly test this out internally.  If you'd like to keep this private, feel free to email the attachment to me directly ([email protected]). 
    Once added, please post back with the bug number and we'll investigate from there.

  • Can an abstract class extend another abstract class?

    Is it possible for an abstract class to extend another abstract class?
    Say
    public abstract class AComponent extends JComponent {
    Thanks.

    Yes

  • Abstract class extending a nonabstract

    i want to know what are the effects , advantages and cases were we want to use this cinda achitecture.
    I have a class(NA) which is NonAbstract, There is a Abstract class(A) which extends a NA. Doing so is legally right, but what are the advantages of doing that are there any situations were we will be using this technique.
    TIA
    Zoha.

    Every abstract class extends a non-abstract class already: Object is non-abstract, and since all abstract classes directly or indirectly extend Object... see?
    So if you can see the reason for abstract classes at all, then you don't need to ask this question.

Maybe you are looking for

  • Applet navigator to open a page in another frame.

    Hello to the Java gurus out there, I was wondering if someone could give me a pointer as to how I can get an applet navigator to open a page in another frame of the web browser? Say for example, I have two frames in the main HTML page where one frame

  • Help! - Tracks linked to application files, not my music !!

    Something very weird is going on here.... I've got about 500 tracks that somehow are linked to application files. For example if I select "Show in Finder" it takes me to: Applications:iWeb.app:Contents:Frameworks:SFApplication.framework:Versions:A:Re

  • Signing in to axis reader

    Hi, I'm trying to log in to my Adobe account to access the Adobe program Axis 360 & Axis Reader.  I need this program to read books from our public library.  I can log in fine through the computer with my login and password, but this same login & pas

  • Modem and Cascading Routers: IP distribution?

    Hello! I've been searching for my case here but couldn't find anything similar. I would really appreciate your help! I have a Sagemcom F@st 2764 ADSL modem and two WRT160N routers. I want to create a network where the IP numbers are distributed by th

  • Incorrect number of subscript accessing external object property loadfile in open event

    Hi I used  the following method to  view pdf  OLE Object Control -> Insert Control -> Then I select Adobe pdf reader. After that I wrote the following script in the open event of the form ole_1.object.loadfile("H:\document\empdoc.pdf") . But when I r