mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Static methods
This commit is contained in:
parent
dd1a619360
commit
41ec7af8e5
@ -523,6 +523,14 @@ namespace Learning
|
|||||||
"\n------------------------------\n"
|
"\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
|
} // end class Bicycle
|
||||||
|
|
||||||
// PennyFarthing is a subclass of Bicycle
|
// PennyFarthing is a subclass of Bicycle
|
||||||
@ -551,7 +559,7 @@ namespace Learning
|
|||||||
* Flags
|
* Flags
|
||||||
* Attributes
|
* Attributes
|
||||||
* Generics (T), Delegates, Func, Actions, lambda expressions
|
* Generics (T), Delegates, Func, Actions, lambda expressions
|
||||||
* Static properties, methods and classes
|
* Static properties
|
||||||
* Exceptions, Interfaces, Abstraction
|
* Exceptions, Interfaces, Abstraction
|
||||||
* LINQ
|
* LINQ
|
||||||
* ASP.NET (Web Forms/MVC/WebMatrix)
|
* ASP.NET (Web Forms/MVC/WebMatrix)
|
||||||
|
Loading…
Reference in New Issue
Block a user