class - C# Enumerations, Structs and Classes -
could enlighten me on main differences in c# between enumerations, structs , classes? use classes type of code never seen need use others?
refering :
introduction objects , classes in c# - introduction
introduction objects , classes in c# - world's classes , objects
in object-oriented programming programmers write independent parts of program called classes. each class represents part of program functionality , these classes can assembled form program.
in our world have classes , objects classes. in our world considered object. example, people objects, animals objects too, minerals objects; in world object. easy, right? classes?
in our world have differentiate between objects living with. must understand there classifications (this how name , concepts of class) of objects. example, i'm object, david object too, maria object. people class (or type). have dog called ricky it's object. friend's dog, doby, object dogs class (or type).
a struct similiar class several differences.
refering structs
a struct value type. understand struct, it's helpful make comparison classes. while struct value type, class reference type. value types hold value in memory declared, reference types hold reference object in memory. if copy struct, c# creates new copy of object , assigns copy of object separate struct instance. however, if copy class, c# creates new copy of reference object , assigns copy of reference separate class instance. structs can't have destructors, classes can have destructors. difference between struct , class struct can't have implementation inheritance, class can...
enumerations unique types allow assign symbolic names integral values.
Comments
Post a Comment