C# Tutorials
C# Methods
C# Classes
C# Examples
OOP stands for Object-Oriented Programming.
Procedural programming is about writing procedures or methods that perform operations on the data, while object-oriented programming is about creating objects that contain both data and methods.
Object-oriented programming has several advantages over procedural programming:
Classes and objects are two main elements of object-oriented programming.
Look at the following picture to see the difference between class and objects:
Fruit
Apple
Banana
Mango
Another example:
Car
Volvo
Audi
Toyota
So, a class is a template of objects, and an object is an instance of a class.
When each item is created, it inherits all variables and methods from the class.