Podcast Beta
Questions and Answers
Welche der folgenden Aussagen ist wahr?
Welche der folgenden Aussagen ist nicht richtig?
Was ist eine Enumeration?
Wie werden Enumerationen erstellt?
Signup and view all the answers
Welche der folgenden Aussagen ist wahr?
Signup and view all the answers
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.