Home  • Programming • C#.NET

Objects in C# programming

Objects are programming constructs that have data, behavior, and identity.
Objects have identity — two objects with the same set of data are not necessarily the same object. You can compare two objects with two table records: both have same field but they are unique.
Objects in C# are defined through classes and structs — these form the single blueprint from which all objects of that type operate. That means all objects have common field, properties and behaviors defined in that class or struct from which they are created.
Everything you use in C# is an object, including Windows Forms and controls.
Objects are instantiated; that is, they are created from templates defined by classes and structs.
Objects use Properties to obtain and change the information they contain.
Objects often have methods and events that allow them to perform actions.
All C# objects inherit from the Object.
public class Customer
{
    //Fields, properties, methods and events go here...
}

Customer object1 = new Customer();  //here object1 is an object

Comments 1


An object name should be a proper noun.

Share

Copyright © 2024. Powered by Intellect Software Ltd