What’s the outcome of calling a method?
Sometimes a message is printed to the console:
Sometimes a value is returned:
Math.Floor(15.6); // Returns 15
Sometimes a variable is altered:
int number; bool success = Int32.TryParse("10602", out number); // number is 10602 and success is True
If you don’t understand all of the code examples, that’s okay! By the end of this lesson you will be able to:
- Define methods with output using the
- Recognize and resolve errors related to method output
Let’s get started!
To remind yourself of some earlier concepts about method input, review the code on the right. We assume you are comfortable with these concepts before taking this lesson.
Take this course for free