Methods (Exercise) – Learn C#

0  comments

This is an exercise for this YouTube video.

Happy learning and good luck!

 

What return type do you use when you don't want the method to return anything?
You can make an expression bodied method by using
You can create a method overload by

 

Assignment: Write a method which will add two integers together.

 

 

Click to see the answer

 

 

 

Assignment: Create a method which will be able to either add or subtract two numbers.

 

 

Click to see the answer

 

 

 

 

About the author 

Matt Rešetár

Matt is an app developer with a knack for teaching others. Working as a Flutter freelancer and most importantly developer educator, he doesn't have a lot of free time 😅 Yet he still manages to squeeze in tough workouts 💪

You may also like

Flutter Bloc & Cubit Tutorial

Flutter Custom & Staggered Page Transition Animation Tutorial

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>