Results 1 to 2 of 2

Thread: Inheritance in C sharp

  1. #1
    JenkinsReed is offline Senior Member
    Join Date
    Dec 2009
    Posts
    169
    Rep Power
    3

    Default Inheritance in C sharp

    I am learning the programming language C#. Currently I am training programs in C # and lately came to a question, how to get multiple inheritance in a C#; any help would be highly appreciated.

  2. #2
    DavisMartin is offline Senior Member
    Join Date
    Dec 2009
    Posts
    174
    Rep Power
    3

    Default

    C# does not support the multiple inheritances directly. So, in order to get multiple inheritances you have to use interface. Interface is able to define methods, properties, indexers, and events, but they are not allowed to do any implementation.

    E.g

    using System;

    interface IConstructionVehicle
    {
    void ExecuteDump();
    void TurnOnBackUpSound();
    }
    interface IVehicle
    {
    void Accelerate();
    void Stop();
    void TurnOnBackUpSound();
    }

Similar Threads

  1. 100 GB Blu-ray from sharp
    By Aaron Nicholas in forum Latest Hardware News
    Replies: 0
    Last Post: 07-30-2010, 05:58 PM
  2. Inheritance and Aggregation
    By PetersonClark in forum Programming
    Replies: 2
    Last Post: 02-01-2010, 05:14 PM
  3. Enumeration in C sharp
    By CarterBaker in forum Programming
    Replies: 2
    Last Post: 01-28-2010, 05:32 PM
  4. types of Inheritance
    By RussellBarnes in forum Programming
    Replies: 2
    Last Post: 01-28-2010, 05:26 PM
  5. Flash Actionscript - Inheritance
    By Walker in forum Programming
    Replies: 2
    Last Post: 04-14-2009, 01:13 PM

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
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48