Top "Enums" questions

A data type consisting of a set of named values called elements, members or enumerators of the type.

How do I make an enum Decodable in swift 4?

enum PostType: Decodable { init(from decoder: Decoder) throws { // What do i put here? } case Image enum CodingKeys: String, CodingKey { case …

swift enums
Enums and Constants. Which to use when?

I was doing some reading on enums and find them very similar to declaring constants. How would I know when …

c# language-agnostic enums
Should an Enum start with a 0 or a 1?

Imagine I have defined the following Enum: public enum Status : byte { Inactive = 1, Active = 2, } What's the best practice to use enum? …

c# .net enums
How to delete an enum type value in postgres?

How do I delete an enum type value that I created in postgresql? create type admin_level1 as enum('classifier', …

postgresql enums
In Java, are enum types inside a class static?

I can't seem to access instance members of the surrounding class from inside an enum, as I could from inside …

java enums scope
How to supply Enum value to an annotation from a Constant in Java

I'm unable to use an Enum taken from a Constant as a parameter in an annotation. I get this compilation …

java enums annotations
troubles declaring static enum, C#

Hi I'm trying to declar a static enum like so: using System; using System.Collections.Generic; using System.Linq; using …

c# static enums
C# enum contains value

I have an enum enum myEnum2 { ab, st, top, under, below} I would like to write a function to test …

c# enums contains
Using nested enum types in Java

I have a data structure in mind that involves nested enums, such that I could do something like the following: …

java enums nested-class
Are default enum values in C the same for all compilers?

When declaring an enum as shown below, do all C compilers set the default values as x=0, y=1, and z=2 …

c enums