F Sharp Enumerations - F Sharp (programming language)

What is F# - Enumerations?

An enumeration is a set of named integer constants.

In F#, enumerations, also known as enums, are integral types where labels are assigned to a subset of the values. You can use them in place of literals to make code more readable and maintainable.

Declaring Enumerations

The general syntax for declaring an enumeration is −

The following example demonstrates the use of enumerations −


On compiling and and executing the program, it produces the below result

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

F Sharp (programming language) Topics