diff options
author | Max Yankov <golergka@gmail.com> | 2013-08-17 23:09:21 +0200 |
---|---|---|
committer | Max Yankov <golergka@gmail.com> | 2013-08-17 23:09:21 +0200 |
commit | 41ec7af8e5ac7e4a7ab8b8fc008466be98b0cdc4 (patch) | |
tree | da6d9a36359a7f0dd9515565cb9eac3bb2014932 /csharp.html.markdown | |
parent | dd1a6193605909f3d6abf7795cd18261b27696b9 (diff) |
Static methods
Diffstat (limited to 'csharp.html.markdown')
-rw-r--r-- | csharp.html.markdown | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/csharp.html.markdown b/csharp.html.markdown index 599aaca3..22fb58e1 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -523,6 +523,14 @@ namespace Learning "\n------------------------------\n" ; } + + // Methods can also be static. It can be useful for helper methods + public static bool DidWeCreateEnoughBycles() + { + // Within a static method, we only can reference static class memebers + return bicyclesCreated > 9000; + } // If your class only needs static members, consider marking the class itself as static. + } // end class Bicycle // PennyFarthing is a subclass of Bicycle @@ -551,7 +559,7 @@ namespace Learning * Flags * Attributes * Generics (T), Delegates, Func, Actions, lambda expressions - * Static properties, methods and classes + * Static properties * Exceptions, Interfaces, Abstraction * LINQ * ASP.NET (Web Forms/MVC/WebMatrix) |