summaryrefslogtreecommitdiffhomepage
path: root/csharp.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'csharp.html.markdown')
-rw-r--r--csharp.html.markdown5
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;
}