Multiple choice technology programming languages

The default type of enum is integer and has a default value 1.

  1. a. true

  2. b. false

  3. c. sometimes

  4. d. depends

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The first enum member defaults to 0, not 1, even though the underlying type is integer. This is true for C#, C++, Java, and most other languages. The default type is indeed integer, but the automatic value assignment starts at 0 unless explicitly specified.