Learn how to write your own classes and create objects from them.
What you will learn
Create classes
Instantiate Objects
Create Methods
Add Properties to classes
Create Abstract Classes and Methods
Implement Encapsulation
Implement Inheritance
Override Methods
Create child or derived classes
Description
object-oriented programming is an approach to programming that
breaks a programming problem into objects that interact with each other.
Objects are created from templates known as classes. You can think of a class as
the blueprint of a building. An object is the actual βbuildingβ that we build based
on the blueprint.
C# is an object-oriented programming language. The four basic principles of object-oriented programming are:
Abstraction Modelling the relevant attributes and interactions of entities as classes to define an abstract representation of a system.
Encapsulation Hiding the internal state and functionality of an object and only allowing access through a public set of functions.
Inheritance Ability to create new abstractions based on existing abstractions.
Polymorphism Ability to implement inherited properties or methods in different ways across multiple abstractions.
Object oriented programming (OOP) is a programming structure where programs are organized around objects as opposed to action and logic. This is essentially a design philosophy that uses a different set of programming languages such as C#. Understanding OOP concepts can help make decisions about how you should design an application and what language to use.
Everything in OOP is placed together as self-sustainable βobjects.β An object is a combination of variables, functions, and data that performs a set of related activities. When the object performs those activities, it defines the objectβs behaviour. In addition, an object is an instance of a class.
Content