Thread: Inheritance

  1. #1
    Registered User
    Join Date
    Mar 2014
    Posts
    1

    Inheritance

    Can someone explain inheritance in c sharp?

  2. #2
    Registered User
    Join Date
    Mar 2014
    Posts
    6
    When a new class needs to use components of an existing class, then instead of recreating(typing again) those variables again in new class, the new class can use the code/variables directly from the existing class, this basically is inheritance.

    The central benefit of inheritance is the re-use of code which saves time and lightens the workload.

    The class that is derived is called the derived/child/subclass and the main class is called the base/parent/superclass. All the non private variables in the main class will available in the derived class.

  3. #3
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    A simple web search for "C# inheritance" turns up dozens of links to good information. Here's the first result: Inheritance (C# Programming Guide), complete with examples and everything!
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inheritance
    By mrafcho001 in forum C++ Programming
    Replies: 8
    Last Post: 03-02-2006, 03:49 PM
  2. Inheritance in c++
    By Non@pp in forum C++ Programming
    Replies: 7
    Last Post: 02-22-2006, 07:24 PM
  3. Inheritance
    By Verdagon in forum C++ Programming
    Replies: 8
    Last Post: 06-12-2005, 10:58 AM
  4. inheritance help...
    By tetra in forum C++ Programming
    Replies: 5
    Last Post: 05-12-2003, 07:56 PM
  5. Inheritance
    By ddavidson in forum C++ Programming
    Replies: 10
    Last Post: 02-28-2003, 11:33 AM