Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Enumerator Üben | Strukturen & Enumeratoren
C# Über die Grundlagen Hinaus
course content

Kursinhalt

C# Über die Grundlagen Hinaus

C# Über die Grundlagen Hinaus

1. Zusätzliche Strukturen & Dateiverarbeitung
2. Strukturen & Enumeratoren
3. Einführung in die Objektorientierte Programmierung (OOP)
4. OOP Essentials
5. OOP-Prinzipien

book
Enumerator Üben

Füllen Sie die Lücken aus, um die Enum-Definition zu vervollständigen. Lesen Sie den Code und finden Sie heraus, wie der Name des Enums lautet und welche Mitglieder es haben sollte.

cs

index

copy
12345678910111213141516171819202122232425262728293031323334353637
using System; class Program { // Fill in the blanks below this line ___ ___ { ___ } static void Main(string[] args) { Potion potion = Potion.Invisibility; switch (potion) { case Potion.Invisibility: Console.WriteLine("You drink the Invisibility potion and vanish from sight!"); break; case Potion.Strength: Console.WriteLine("You drink the Strength potion and feel a surge of power!"); break; case Potion.Healing: Console.WriteLine("You drink the Healing potion and your wounds magically mend."); break; case Potion.FireResistance: Console.WriteLine("You drink the Fire Resistance potion and become impervious to flames."); break; case Potion.Teleportation: Console.WriteLine("You drink the Teleportation potion and find yourself in a new location!"); break; default: Console.WriteLine("Invalid potion type!"); break; } } }

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 11
We're sorry to hear that something went wrong. What happened?
some-alt