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()
{
.........
}
}

 
Author : Valli Perumal

5 comments:

  1. 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!

    ReplyDelete
  2. 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

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

    ReplyDelete
  4. With thanks! Valuable information!

    ReplyDelete
  5. good stuff. I will make sure to bookmark your blog.

    ReplyDelete

Powered by Blogger.