Part 6: C# Tutorial – Abstract Classes




In this article we will cover following points:

1.Abstract class basics
2. Abstract classes members
3. Abstract methods
4. Abstract Properties
5. Abstract class implementing an interface

Abstract classes

1.An abstract class is created using the abstract keyword.

2. An abstract modifier can be used with classes, methods, properties, indexers and events.

3. An abstract modifier indicates missing or incomplete implementation of the member which is
marked as abstract.

4. An abstract class cannot be instantiated.

5. An abstract class may contain abstract members (methods, properties, indexers and events)
but its not essential/mandatory.

6. An abstract class cannot be sealed. Because the sealed modifier prevents a class from
being inherited and the abstract modifier requires a class to be inherited.

7. A non-abstract class derived from an abstract class must include actual implementations of
all inherited abstract methods and accessors.

8. If the class does not provide implementation for all the abstract members inherited from the
abstract class then the child class has to be marked as abstract.

Abstract methods

1.Use the abstract modifier in a method or property declaration to indicate that method or
property does not contain implementation.

2. An abstract method is implicitly a virtual method.

3. Abstract method declaration are only permitted inside abstract classes.

4. It is an error to use the static or virtual modifiers in an abstract method declaration.

Abstract properties

1.It is an error to use the abstract modifier on a static property.

2. An abstract inherited property can be overridden in a derived class by including a property
declaration that uses override modifier.

Abstract class implementing an interface

1.An abstract class must provide implementation for all interface members.

2. An abstract class that implements an interface might mark the interface methods as abstract
methods to avoid providing method implementation.


17 thoughts on “Part 6: C# Tutorial – Abstract Classes

  1. reference

    Heya i am for the first time here. I came across this board and I to find It truly helpful & it helped me out much. I hope to provide one thing again and aid others like you helped me.

  2. JimVYamazaki

    Hi! Someone within my Myspace group shared this site along
    with us so I arrived at look it over. I’m definitely loving the details.

    I’m book-marking and will be tweeting this to my followers!
    Great blog and great style and design.

  3. GilWCorrie

    It’s actually very complicated in this packed
    with activity life to listen news on Television, so I simply use internet for the purpose, and get
    the most current information.

  4. Bryan Netrosio

    Hi There! We are searching for experienced people that are interested in from working their home on a part-time basis. If you want to earn $500 a day, and you don’t mind developing some short opinions up, this might be perfect opportunity for you! Simply click the link here NOW!

  5. Demarcus Wascom

    Hi There! We are looking for experienced people that might be interested in from working their home on a full-time basis. If you want to earn $200 a day, and you don’t mind writing some short opinions up, this is the perfect opportunity for you! Simply check out the link here NOW!

  6. over here

    Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I cant believe youre not more popular because you definitely have the gift.

  7. Edison Haydt

    Hi There! We are looking for some people that are interested in from working their home on a full-time basis. If you want to earn $500 a day, and you don’t mind writing some short opinions up, this is the perfect opportunity for you! Simply check out the link here NOW!

  8. Heide Pietryga

    Hi There! We are searching for some people that might be interested in from working their home on a full-time basis. If you want to earn $100 a day, and you don’t mind developing some short opinions up, this is the perfect opportunity for you! Simply check out the link here NOW!

  9. borvest inkral

    Hi there, You’ve performed an excellent job. I will definitely digg it and personally suggest to my friends. I’m sure they will be benefited from this web site.

Leave a Reply

Your email address will not be published. Required fields are marked *