TGViewer
C# 1001 notes C# 1001 notes @csharp_1001_notes · 6.67K subscribers
Post #193 944
What is enum in C#?

An enum is a value type with a set of related named constants often referred to as an enumerator list. The enum keyword is used to declare an enumeration. It is a primitive data type, which is user defined. An enum is used to create numeric constants in .NET framework. All the members of enum are of enum type. Their must be a numeric value for each enum type.

Some points about enum:

🔸 Enums are enumerated data type in C#.

🔸 Enums are strongly typed constant. They are strongly typed, i.e. an enum of one type may not be implicitly assigned to an enum of another type even though the underlying value of their members are the same.

🔸 Enumerations (enums) make your code much more readable and understandable.

🔸 Enum values are fixed. Enum can be displayed as a string and processed as an integer.

🔸 The default type is int, and the approved types are byte, sbyte, short, ushort, uint, long, and ulong.

🔸 Enums are value types and are created on the stack and not on the heap.
More from @csharp_1001_notes
  1. Sep 28, 2026«Ядро Windows NT во многом превосходит Linux», считает исследовательница Google и бывший р…
  2. Sep 24, 2026Ваш .NET API работает локально. Готов ли он к продакшену? Чек-лист из 8 проверок перед рел…
  3. Sep 20, 2026🧩 C# Channels: сообщение попало в очередь. Почему обработчик его не получил? Два воркера…
  4. Sep 16, 2026Эта задача проверяет понимание Memory<T>, pooling, ownership, IAsyncEnumerable, cancellati…
  5. Sep 16, 2026# C# 14: хитрая задача на ArrayPool, IAsyncEnumerable и время жизни памяти Есть поток данн…
  6. Sep 14, 2026# C# 14: конкурентный кеш без race condition Реализуйте потокобезопасный кеш: public seale…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →