Classes are like templates to object instances
An object may include variables or be identified by one.
Say I have a Person class
public class Person
{
public string Name {get; set;}
public byte Age {get; set;}
}
I can create Person objects out of the Person class.
Person person = new Person{Name="Shalom", Age=30};
Person is the type. It means the object will follow the Person class template person is often simply called variable name (or variable for short) but you may meet other terms such as identifier or handle.
The statement after the equal sign is calling a constructor. It uses Object Initializer syntax here. It results in the creation of an object being an instance of the Person class.
Hi,
classes are nothing more than blueprints that describe what an object will be. Fields and methods are defined in the class, but no memory is allocated. An object is an instance of a class, when you instantiate an object memory is allocated and all fields and methods of the class are accessible.