Podcast
Questions and Answers
Welche der folgenden Aussagen ist wahr?
Welche der folgenden Aussagen ist wahr?
- Enumerationen können geerbt werden. (correct)
- Enumerationen sind Primitivdatentypen.
- Enumerationen können nur in bestimmten Bereichen definierte Werte haben.
- Enumerationen können nicht verwendet werden, um Informationen über den Status von Objekten zu speichern.
Welche der folgenden Aussagen ist nicht richtig?
Welche der folgenden Aussagen ist nicht richtig?
- In einem Switch-Statement kann ein Enum-Typ oder ein Datentyp verwendet werden, der die equals()-Methode hat.
- In einem Switch-Statement kann ein Code-Block ausgewählt werden, der dem verwendeten Variablen zugewiesen wird
- Enumerationen können nur mit == verglichen werden. (correct)
- Enumerationen sind eine Erweiterung der Klasse java)lang.Enum.
Was ist eine Enumeration?
Was ist eine Enumeration?
- Eine Sammlung von ähnlichen Elementen, die nach Namen abgerufen werden können.
- Ein Datentyp, der nur in bestimmten Bereichen definierte Werte haben kann.
- Eine Klasse, die zusätzliche Felder und Methoden enthalten kann.
- Eine Sammlung von Konstanten, die zusammen gruppiert werden können. (correct)
Wie werden Enumerationen erstellt?
Wie werden Enumerationen erstellt?
Welche der folgenden Aussagen ist wahr?
Welche der folgenden Aussagen ist wahr?
Study Notes
-
An enumeration is a collection of similar items that can be accessed by name.
-
Enumerations can be created in two different ways--one with a static initializer and one with a constructor.
-
Every enumeration has a name and an integer value that represents that enumeration.
-
Enumerations can be used to group together a set of related constants.
-
Enumerations can be used to store information about the status of objects.
-
Enumerations can have values that are defined only in certain ranges.
-
An enumeration can have values that are defined by an interface.
-
Enumerations can be inherited by other classes or modules.
-
Enums are reference types
-
Every value is possible to compare with ==, but not all values can be used in a text representation.
-
Enums are an extension of the java.lang.Enum class.
-
The constructor is private, and users cannot create their own elements.
-
Each enum constant has a name, a ordinal, and a toString() method.
-
Enums are classes, and can contain additional fields and methods.
-
Enums can also have constructors, just like other classes.
-
In a switch statement, you can use an enum type or a datatype that has the equals() method.
-
You can use a switch statement to select one of several code blocks depending on the value of a variable.
-
The code block that is selected is assigned to the variable that was used in the switch statement.
-
You can also use a switch statement to select one of several values for a variable.
-
The code block that is selected is executed.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.