Podcast
Questions and Answers
What is an enumeration in object-oriented programming?
What is an enumeration in object-oriented programming?
- A class that contains only static methods
- A predefined data type with a set of name-value pairs (correct)
- A data type used to store a single value
- An array with named elements
What is the default initial value of the first element in an enumeration?
What is the default initial value of the first element in an enumeration?
- 100
- 10
- 0 (correct)
- 1
In an enumeration, how can you change the initial value of the elements?
In an enumeration, how can you change the initial value of the elements?
- The initial value cannot be changed
- Create a new enumeration for each different initial value
- Specify the desired initial value after the element name (correct)
- Use a separate method to set the initial value
What is the default storage type used to hold the values of an enumeration?
What is the default storage type used to hold the values of an enumeration?
In an enumeration, do the numerical values need to be unique?
In an enumeration, do the numerical values need to be unique?
Which of the following best describes the purpose of using an enumeration?
Which of the following best describes the purpose of using an enumeration?
What does the ToString() method return for an enumeration variable?
What does the ToString() method return for an enumeration variable?
Which method is used to obtain the data type used to store the values of an enumerated type?
Which method is used to obtain the data type used to store the values of an enumerated type?
How do you declare an enum variable in C#?
How do you declare an enum variable in C#?
What happens if you forget to scope the enum name when assigning a value to an enum variable?
What happens if you forget to scope the enum name when assigning a value to an enum variable?
What is the purpose of changing the underlying type of an enumeration?
What is the purpose of changing the underlying type of an enumeration?
What is the result if you set an enum variable to a value not defined directly by the enumerated type?
What is the result if you set an enum variable to a value not defined directly by the enumerated type?
How can you obtain the numerical value of an enumeration variable?
How can you obtain the numerical value of an enumeration variable?
Which class provides methods to interrogate and transform a given enumeration?
Which class provides methods to interrogate and transform a given enumeration?
In which case will forgetting to scope the enum name result in an error?
In which case will forgetting to scope the enum name result in an error?
What does System.Type represent in .NET?
What does System.Type represent in .NET?
Flashcards are hidden until you start studying