diff options
author | Max Yankov <golergka@gmail.com> | 2013-08-17 23:09:07 +0200 |
---|---|---|
committer | Max Yankov <golergka@gmail.com> | 2013-08-17 23:09:07 +0200 |
commit | dd1a6193605909f3d6abf7795cd18261b27696b9 (patch) | |
tree | 0b98cc2f8455e6264af99c76c13ce74616baacfc /csharp.html.markdown | |
parent | ccdc21900d090a88ca02e25007f4e3c197b8f50e (diff) |
C#: default parameter values
Diffstat (limited to 'csharp.html.markdown')
-rw-r--r-- | csharp.html.markdown | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/csharp.html.markdown b/csharp.html.markdown index fefcb0bb..599aaca3 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -482,12 +482,13 @@ namespace Learning gear = newValue; } - public void SpeedUp(int increment) + // Method parameters can have defaut values. In this case, methods can be called with these parameters omitted + public void SpeedUp(int increment = 1) { _speed += increment; } - public void SlowDown(int decrement) + public void SlowDown(int decrement = 1) { _speed -= decrement; } |