Methods: Turning an English Task into Code
Textbook: BJP Ch 3 (static methods, parameters, return values)
Where you are: Week 0 review > Methods
This part of the review is three short lessons. Work them in order:
- The method header and how a method works: the fixed header slots, typed versus
void, and returning a value. - Turning an English task into a method: reading the return type, name, and parameters out of the sentence before writing the body.
- Pass-by-value: the copy rule: why a method gets a copy of a primitive, and what that means for the caller.
Finish all three before moving on to arrays, search, and sort.
Resources
Canonical: BJP (Reges and Stepp) §3.1-3.2 (parameters, return values); Liang 10e §6 (Methods). Section numbers are grounded from the published tables of contents; exact page numbers depend on the printing and are pending a faculty spot-check.
Show 2 more resources
- Practice: code.jdoner.me CSCD 210 methods exercises (coding practice and tracing).
- Video (URL pending verification): BroCode, Java methods.