Unit 5 · 3 lessons
Methods
Breaking a program into named, reusable pieces — writing and calling methods, passing values into them, and designing a whole program out of small parts that each do one job.
- 31 practice questions
- 30 flashcards
Lessons
- 1Writing and Calling MethodsWhat a method is, how to read a signature one piece at a time, the difference between void and returning, and exactly where execution goes when you call one.10 questions
- 2Parameters, Arguments and ScopeHow values get into a method, why changing a parameter never changes the caller's variable, where a variable is allowed to exist, and how one name can belong to several methods.11 questions
- 3Decomposition and Program DesignTurning one long main into a set of small methods that each do one job — naming them, testing them with stubs, and designing from the top down.10 questions