4. Struct, Classes

CultureInfo Class

CultureInfo is a class in the System.Globalization namespace that provides information about cultural conventions, such as currency formats, country codes, and other locale-specific details.

Struct vs. Class

A struct is a value type stored on the stack, while a class is a reference type stored on the heap.

Other differences include:

Equals vs. ReferenceEquals

C# offers two main ways to compare objects:

In practice:

Arrow Functions in C#

If a method or property contains only a single statement, you can use arrow syntax (=>). For example:

public int GetAge() => age;

This syntax is concise and can be applied to getters in properties or short method definitions.

Properties in C#

Properties wrap fields with get and set accessors.

Reference

The content in this document is based on the original notes provided in Azerbaijani. For further details, you can refer to the original document using the following link:

Original Note - Azerbaijani Version