Objects

What is an object ?

Object – An object is basically a self-contained entity that accumulates both data and procedures to manipulate the data. Objects are merely instances of classes.

In C# objects are created using the new keyword. Actually new is an operator, creates an object of the specified class and returns a reference to that object. Here is an example : 

public class Exercise

{

public void welcome()

{

Console.writeLine("This is Exercise class");

}

}

public class classl

{

static void Main()

{

Exercise exo = new Exercise ();

}

 

Leave Comment

Important Topics

Title
Object Oriented Programming (OOP)
OOP vs POP
Class with Example
Objects
Access Modifiers
Encapsulation with example
C# Properties (GET, SET)
Method and Function
Abstraction
Polymorphism
Operator Overloading
Inheritance
Constructor and its Types
Exception Handling
Throwing an Exception