Difference between Concrete class and Abstract class

Let’s have a look at the Concrete class and Abstract class.

Concrete class:-

  1. A concrete class is nothing but normal class, we can use as a base class or may not.
  2. Not compulsory, it can’t contain abstract methods.
  3. We can instantiate the object and work with this class.

Eg :

class Sample
{
public void MyMethod()
{…………..}
}

Abstract class:-

  1. An abstract class is a class which declared with a keyword Abstract.
  2. Must be used as a base class.
  3. Only intention to declare an abstract class is to use as a base class that is we can’t create an object of this class like concrete class.
  4. It can contain abstract methods as well as concrete (normal) methods.

Eg :

public abstract class MyClass
{
public void MyMethod()
{…………..}

public abstract TestMethod()
{
………
}
}

 

Print Friendly, PDF & Email
Spread the love

5 thoughts on “Difference between Concrete class and Abstract class

  • March 22, 2018 at 1:54 am
    Permalink

    I was recommended this website via my cousin. I am now not
    sure whether or not this submit is written by means of him as nobody
    else realize such special about my problem. You’re amazing!

    Thanks!

    Reply
  • April 19, 2018 at 2:07 pm
    Permalink

    Hi! This is kind of off topic but I need some guidance from an established
    blog. Is it very difficult to set up your own blog? I’m not very techincal but I can figure
    things out pretty quick. I’m thinking about creating my
    own but I’m not sure where to start. Do you have any tips or suggestions?
    With thanks

    Reply
  • June 22, 2018 at 1:13 pm
    Permalink

    I spent a great deal of time to find something like this

    Reply

Leave a Reply

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