Results 1 to 6 of 6

Thread: Event handlers vs. base class method overrides

  1. #1
    Join Date
    Jun 2011
    Posts
    59

    Event handlers vs. base class method overrides

    Hi, I am a BSC.IT student and I am learning the language called C# and in that there are two topics as I describe in the title, I just came across both of them but didn’t get the actual difference between them, in fact I don’t even know which one to put where it is needed. And whenever I have to use such a function in the source code, I just have to write it as it is given in the books, but what if I developed my project, so need explanation if possible. Thanks.

  2. #2
    Join Date
    May 2009
    Posts
    637

    Re: Event handlers vs. base class method overrides

    There is much difference in both of the name that you have mentioned, I would like to tell you about that, actually overriding means to use the same method with the same name in the child class, but only the parameters are different in both of the methods, If suppose take the example of the calculating the area, and if you want to calculate the area of two to three different object, then you have to take three different names rather you can use the same name for each, just the different parameters.

  3. #3
    Join Date
    May 2009
    Posts
    511

    Re: Event handlers vs. base class method overrides

    Event handlers are the class that handles the various events in the programs that is caused byt the various activities, like for example Mouse clicks, Keyboard presses, etc. and this functions is given in all the API’s and off course the working of them is also different in all the platforms, and if you compare it with other languages event handling in C sharp is more rather additional simplified, we can handle them with very efficiently.

  4. #4
    Join Date
    May 2009
    Posts
    543

    Re: Event handlers vs. base class method overrides

    I would like to tell you about the events like it is a mechanism through which a class can inform its clients when some events happen. And most importantly whenever the user does any activity an event is generated behind this. And in C sharp there is some another topic also along with that that’s the delegate, and this is just a theory explanation, but if you want to know more about the programs you can simply go through different websites also for the same, where you’ll get different examples also.

  5. #5
    Join Date
    May 2009
    Posts
    529

    Re: Event handlers vs. base class method overrides

    See I would say if you want to know about the method overriding, so first of all you need to have some knowledge about the polymorphism if you just get an idea about that then surely you can have idea about the overriding also, because they all are rely upon each other. And I would say if you know about the virtual function in C++ then you can very easily learn about the method overriding in C#.

  6. #6
    Join Date
    Apr 2009
    Posts
    488

    Re: Event handlers vs. base class method overrides

    As you have mentioned that you want to know about the difference between both the topic, then I would like to say that the topic are different from each other, but you can make use of both the things with each other, and I think you seems confused in that only. i mean to say you can also Inherit Event Handlers also, and the same you can use in the component also.

Similar Threads

  1. Using sizeof () class with empty base class in GCC
    By Alfiee in forum Software Development
    Replies: 6
    Last Post: 27-06-2011, 10:31 AM
  2. Replies: 4
    Last Post: 08-01-2011, 07:52 AM
  3. How Event Handlers Work together
    By Savannah87 in forum Software Development
    Replies: 5
    Last Post: 06-03-2010, 06:44 AM
  4. Replies: 5
    Last Post: 12-02-2010, 06:23 PM
  5. Use event handlers in vb.net
    By Gallard in forum Software Development
    Replies: 3
    Last Post: 26-01-2009, 03:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,719,330.04790 seconds with 17 queries