summaryrefslogtreecommitdiffhomepage
path: root/csharp.html.markdown
diff options
context:
space:
mode:
authorMelvyn <melvyn.laily@gmail.com>2013-09-21 15:49:20 -0400
committerMelvyn <melvyn.laily@gmail.com>2013-09-21 15:49:20 -0400
commit3b5e4837bda104ca6e23b65327f819953d1c1b2e (patch)
treea952bce046ea65f5b1b1c921e5d0deefea7dcaa2 /csharp.html.markdown
parent67b9af44925a66ac0dc278050bcaaa80fd50f21c (diff)
more details for the enums (C#)
Diffstat (limited to 'csharp.html.markdown')
-rw-r--r--csharp.html.markdown9
1 files changed, 6 insertions, 3 deletions
diff --git a/csharp.html.markdown b/csharp.html.markdown
index dcbb30d1..76af24af 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -359,7 +359,7 @@ namespace Learning
///////////////////////////////////////
- // Converting Data Types And Typcasting
+ // Converting Data Types And Typecasting
///////////////////////////////////////
// Converting data
@@ -413,7 +413,7 @@ namespace Learning
// Class Declaration Syntax:
- // <public/private/protected> class <class name>{
+ // <public/private/protected/internal> class <class name>{
// //data fields, constructors, functions all inside.
// //functions are called as methods in Java.
// }
@@ -428,11 +428,14 @@ namespace Learning
string name; // Everything is private by default: Only accessible from within this class
// Enum is a value type that consists of a set of named constants
+ // It is really just mapping a name to a value (an int, unless specified otherwise).
+ // The approved types for an enum are byte, sbyte, short, ushort, int, uint, long, or ulong.
+ // An enum can't contain the same value twice.
public enum Brand
{
AIST,
BMC,
- Electra,
+ Electra=42, //you can explicitly set a value to a name
Gitane
}
// We defined this type inside a Bicycle class, so it is a nested type