Learn about Class & Object in C#

Class in C#

Class Contains Data members for storing data and member functions to perform the action on that data.

Object in C#

It's a class variable. Used to access class methods.

Example

using System;

namespace ClassObject
{
    class Dog
    {
        string breed;

        public void bark()
        {
            Console.WriteLine("Bark Bark !!");
        }

        static void Main(string[] args)
        {
            // create Dog object 
            Dog bullDog = new Dog();

            // access breed of the Dog 
            bullDog.breed = "Bull Dog";
            Console.WriteLine(bullDog.breed);

            // access method of the Dog
            bullDog.bark();

            Console.ReadLine();
        }
    }
}

Happy Coding!

Thanks.