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

Зміст курсу

C# Beyond Basics

Defining ClassesDefining Classes

The syntax for defining a basic class is the following:

cs

index.cs

For example, a class for storing data about houses:

cs

index.cs

The above code contains a class that defines a blueprint for a 'House' object, representing a house that can store the ownerName, land area, country, state, city and street address.

Using the term public before every field in the class is a discouraged practice however for the sake of simplicity we will be using the public keyword for the fields until we learn about Access Modifiers in the next section. The public keyword makes it possible to access the field data from the classes directly.

Using objects is very convenient as we can group related information to form a Class and neatly create multiple instances of that data if needed. Using the House class we can easily store and access data for thousands of houses.

Which keyword is used for defining a class?

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

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

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

Зміст курсу

C# Beyond Basics

Defining ClassesDefining Classes

The syntax for defining a basic class is the following:

cs

index.cs

For example, a class for storing data about houses:

cs

index.cs

The above code contains a class that defines a blueprint for a 'House' object, representing a house that can store the ownerName, land area, country, state, city and street address.

Using the term public before every field in the class is a discouraged practice however for the sake of simplicity we will be using the public keyword for the fields until we learn about Access Modifiers in the next section. The public keyword makes it possible to access the field data from the classes directly.

Using objects is very convenient as we can group related information to form a Class and neatly create multiple instances of that data if needed. Using the House class we can easily store and access data for thousands of houses.

Which keyword is used for defining a class?

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

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

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