+ 1

C# OOP

What is the difference between a class and an object in C#?

5th Jan 2024, 10:21 PM
Slavik Avetisyan
Slavik Avetisyan - avatar
2 ответов
+ 5
A class is a blueprint or template that defines the structure and behavior. An object is an instance of a class, representing a specific occurrence with its own state and behavior. In simpler terms, a class is like a recipe, and an object is the actual dish you create using that recipe.
5th Jan 2024, 10:22 PM
Ruben Melikyan
Ruben Melikyan - avatar
+ 2
Slavik Avetisyan , You and I are objects (also called instances) of class Human.
5th Jan 2024, 10:40 PM
Rain
Rain - avatar