Concrete type and Concrete method in C#

Shervan360 1,681 Reputation points
2022-10-06T00:09:03.553+00:00

What is exactly concrete type and concrete method in C#? Is the same with abstract type?
Could you please write an example?

Thanks

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

Locked Question. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Jack J Jun 25,316 Reputation points
    2022-10-06T05:35:56.277+00:00

    @Shervan360 , Welcome to Microsoft Q&A,

    What is exactly concrete type and concrete method in C#?

    A concrete class is a class that allows creating an instance or an object using the new keyword.

    A concrete method is a method that can be called directly.

    Is the same with abstract type?

    No, the abstract type is different from Concrete type. Abstract type must be decorated with the abstract keyword and it can not be instantiated.

    Abstract methods are those which need to be implemented in subclass/child class. Abstract methods are only defined in superclass/parent class(Abstract class) but with no body.

    You could look at the following code example to know more about it.

    public abstract class Animal      ->abstract type  
        {  
            public abstract void Talk();      ->abstract method  
            public abstract void Move();   ->abstract method  
        }  
      
        public class Human : Animal  ->Concrete type  
        {  
            public override void Talk()  ->Concrete method  
            {  
                Console.WriteLine("This blog post is awesome! :)");  
            }  
      
            public override void Move()  
            {  
                Console.WriteLine("I'm walking on 2 feet.");  
            }  
        }  
    

    Hope my explanation could help you.

    Best Regards,
    Jack


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful