Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
What is Object-Oriented Programming? | Introduction to Object-Oriented Programming (OOP)
course content

Зміст курсу

C# Beyond Basics

What is Object-Oriented Programming?What is Object-Oriented Programming?

Class is basically a blueprint for creating some objects that store data. A class can have fields, and it can also have methods.

The following diagram shows an example of a Class with its objects:

However, this is the illustration we used in the previous section when we were learning about Structs so you might ask, what's the difference?

In terms of basic concepts, Classes and Structs are essentially the same. However, Structs are a more limited version of Classes. Unlike structs, the classes can form all kinds of complex relationships with each other, for-example a class can be a child of another class and can contain additional functionalities. In this section we will learn about all the concepts of Classes which are very similar to Structs. In the next section we will build on top of this knowledge and learn about all the intricacies of classes.

Object-Oriented Programming, or OOP, is a programming paradigm or in simple words a method of programming, that organizes data and methods predominantly within classes. In this paradigm, the entire code revolves around the concept of classes and their objects, giving this method the name Object-Oriented Programming.

A paradigm is a way to classify a method of programming. For example, Functional programming is a paradigm in which programs are constructed by writing functions. Programming languages are often classified by paradigms; for-example, Haskell is called a functional programming language.

C# is an Object-Oriented programming language. This is also apparent from the base code of a C# program:

cs

index.cs

Here the Main method is inside the ConsoleApp class which represents the program itself. Any code we write is almost always inside a class or related to a class.

1. What is a class in programming?
2. What distinguishes classes from structs?

What is a class in programming?

Виберіть правильну відповідь

What distinguishes classes from structs?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 3. Розділ 1
course content

Зміст курсу

C# Beyond Basics

What is Object-Oriented Programming?What is Object-Oriented Programming?

Class is basically a blueprint for creating some objects that store data. A class can have fields, and it can also have methods.

The following diagram shows an example of a Class with its objects:

However, this is the illustration we used in the previous section when we were learning about Structs so you might ask, what's the difference?

In terms of basic concepts, Classes and Structs are essentially the same. However, Structs are a more limited version of Classes. Unlike structs, the classes can form all kinds of complex relationships with each other, for-example a class can be a child of another class and can contain additional functionalities. In this section we will learn about all the concepts of Classes which are very similar to Structs. In the next section we will build on top of this knowledge and learn about all the intricacies of classes.

Object-Oriented Programming, or OOP, is a programming paradigm or in simple words a method of programming, that organizes data and methods predominantly within classes. In this paradigm, the entire code revolves around the concept of classes and their objects, giving this method the name Object-Oriented Programming.

A paradigm is a way to classify a method of programming. For example, Functional programming is a paradigm in which programs are constructed by writing functions. Programming languages are often classified by paradigms; for-example, Haskell is called a functional programming language.

C# is an Object-Oriented programming language. This is also apparent from the base code of a C# program:

cs

index.cs

Here the Main method is inside the ConsoleApp class which represents the program itself. Any code we write is almost always inside a class or related to a class.

1. What is a class in programming?
2. What distinguishes classes from structs?

What is a class in programming?

Виберіть правильну відповідь

What distinguishes classes from structs?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 3. Розділ 1
some-alt