01Chapter 1: Declare and Call a MethodA method is a named set of instructions in a Java program. You write the instructions once, then ask Java to run them whenever you need them. Asking Java to run a method is called a method call.5 min read
02Chapter 2: Pass Arguments to ParametersA method can do the same job with different information each time it runs. For example, a ticket-printing method can print a ticket for Ava, then print another for Noah.5 min read
03Chapter 3: Return Results or Use voidA method is a named set of instructions that a program can run. Some methods produce a result for the rest of the program to use. Others perform an action without producing a result.5 min read
04Chapter 4: Call Static and Instance MethodsIn Java, a method is a named set of instructions that can be called, or run. Some methods belong to a class. Others work with a particular object.6 min read
05Chapter 5: Understand Parameter and Local Variable ScopeA variable has a name that you can use to refer to a value. But you cannot use that name everywhere in a Java program. Its scope is the part of the program where the name is available.5 min read
07Chapter 7: Control Method AccessAn access modifier is a word in a method declaration that controls which code can call the method. Java has three method access modifiers: public, protected, and private. A method can also have no access modifier.5 min read
08Chapter 8: Overload Methods with Different ParametersA method is a named set of instructions. In Java, you can give several methods the same name if they accept different inputs. This is called method overloading.5 min read
09Chapter 9: Accept Variable Numbers of ArgumentsSometimes a method needs to accept a list of values, but the caller does not know how long the list will be. For example, a method that adds scores might need to handle one score, several scores, or none.5 min read
10Chapter 10: Handle and Declare ExceptionsA method cannot always finish its work. A number may be in the wrong format, or a file may be unavailable. In Java, a method can signal a problem by throwing an exception. An exception is an object that describes a problem during a program’s run.6 min read
11Chapter 11: Write Methods That Call ThemselvesA recursive method is a method that calls itself. It solves a problem by asking the same method to solve a smaller version of that problem.5 min read
12Chapter 12: Override Instance MethodsA child class can provide its own version of a method from a parent class. This is called overriding. It lets related objects respond differently to the same method call.5 min read
13Chapter 13: Write Generic MethodsA generic method is a method that can work with more than one type while keeping type checks. A type describes what kind of value something can hold, such as text or a whole number.5 min read
14Chapter 14: Design Clear Method ContractsA method is a named set of instructions. When you call a method, you ask it to run. A method contract is the agreement between the method and the code that calls it.5 min read