What is an object reference in C#?

Experience Level: Junior
Tags: C#

Answer

When you create an object, it gets stored to memory. In the source code the newly created objects are assigned to variables. But in many cases the variable doesn't hold the whole object. It holds just link to a location in memory where the object is stored. This link is called an object reference because it refers to a location in memory where the object is stored.

Related C# job interview questions
C# for beginners
C# for beginners

Are you learning C#? Try our test we designed to help you progress faster.

Test yourself