C# Interview Question #13

What is an object in C#?

OOP & Core C# Concepts Junior Beginner

Quick Interview Answer

An object is an instance of a class. The class defines the structure and behavior, while the object represents a concrete runtime instance.

Detailed Explanation

An object is an instance of a class. The class defines the structure and behavior, while the object represents a concrete runtime instance.

Multiple objects can be created from the same class, and each object can hold different property values.

Code Example

Car car1 = new Car { Brand = "Toyota" };
Car car2 = new Car { Brand = "Honda" };