Scrigroup - Documente si articole

Username / Parola inexistente      

Home Documente Upload Resurse Alte limbi doc  

AccessAdobe photoshopAlgoritmiAutocadBaze de dateCC sharp
CalculatoareCorel drawDot netExcelFox proFrontpageHardware
HtmlInternetJavaLinuxMatlabMs dosPascal
PhpPower pointRetele calculatoareSqlTutorialsWebdesignWindows


C sharp

+ Font mai mare | - Font mai mic


Trimite pe Messenger
Assignment operators
Declaration statements
Standard conversions
Enums - declarations, Enums members
Reference types: The string type
Structs - Struct declarations
Attributes - Attribute classes
Type declarations
Value types: Struct types, Simple, Integral, Floating


An enum type declaration defines a type name for a related group of symbolic constants. Enums are used for “multiple choice” scenarios, in which a runtime decision is made from a fixed number of choices that are known at compile-time.

The example

enum Color

class Shape


shows a Color enum and a method that uses this enum. The signature of the Fill method makes it clear that the shape can be filled with one of the given colors.

The use of enums is superior to the use of integer constants—as is common in languages without enums—because the use of enums makes the code more readable and self-documenting. The self-documenting nature of the code also makes it possible for the development tool to assist with code writing and other “designer” activities. For example, the use of Color rather than int for a parameter type enables smart code editors to suggest Color values.

Politica de confidentialitate



Vizualizari: 440
Importanta: rank

Comenteaza documentul:

Te rugam sa te autentifici sau sa iti faci cont pentru a putea comenta

Creaza cont nou

Termeni si conditii de utilizare | Contact
© SCRIGROUP 2021 . All rights reserved

Distribuie URL

Adauga cod HTML in site