In several of the previous exercises, we found ourselves repeating code. For example, we did an exercise where one button increased a number and displayed it on screen, and another decreased the number and displayed it on screen. The code needed to display the number on the screen was identical in both cases. Functions (or methods) allow us to extract common pieces of code like this so we can reuse them multiple times. We've already seen functions before. In this section, we're going to learn the nuts and bolts of how functions actually work.

Continue this course: https://www.udacity.com/course/java-programming-basics--ud282

Finish Lesson 3: Functions.

Try: Do the Lesson 3 Problem Set, at the end of the lesson.

results matching ""

    No results matching ""