In AP Computer Science A, the method header is the first line of a method declaration. It lists the access modifier (like public), the return type (like int or void), the method name, and the parameter list, telling Java exactly how the method is called and what it gives back.
The method header is the first line of any method you write in Java. It packs four pieces of information into one line: the access modifier (usually public or private), the return type (a primitive like int, a class type like String, or void if nothing comes back), the method name, and the parameter list in parentheses.
For example, in public int countPositives(int[] arr), the header tells you everything you need to call the method correctly. You know it's accessible from other classes, it hands back an int, it's named countPositives, and it needs one argument, an array of ints. The header is basically the method's contract. The body (everything inside the curly braces) is the implementation, but the header is the promise about inputs and outputs. Reading headers carefully is one of the most underrated AP skills, because every FRQ hands you headers and expects you to honor them exactly.
Method headers show up the moment you start using objects and calling methods, and they become something you write yourself in Unit 5 (Writing Classes). Every class you design requires you to choose the right access modifier, return type, and parameter list for each method, and a wrong header means a method that won't compile or can't be called the way the question requires.
Headers also matter for the exam's biggest workflow: on free-response questions, College Board gives you a method header and you fill in the body. If you ignore the return type or rename a parameter, your solution breaks even if your logic is perfect. The header is the rulebook for the method you're about to write.
Method declaration (Unit 5)
The declaration is the whole package, header plus body. The header is just line one. Think of the header as the label on the box and the body as what's inside it.
Return type and the return statement (Units 1 & 5)
The return type in the header and the return statement in the body have to agree. If the header says int, the body must return an int on every path. A void header means no return value at all, which changes how you call the method.
Access modifiers (Unit 5)
The public or private keyword at the front of the header controls who can call the method. On the AP exam, methods other classes use are public, and helper methods kept inside the class are private. That single word is your encapsulation tool.
@Override and inheritance (Unit 9)
When a subclass overrides a method, its header must match the superclass version's name, parameter list, and return type. The header is literally how Java decides whether you're overriding a method or accidentally creating a brand-new one.
Multiple-choice questions love header-reading. A classic stem asks which header correctly defines a method, like one that takes an array of integers and returns the product of its positive values. You'd need to spot that the parameter must be int[] and the return type int, not void or boolean.
On the free response, headers are everywhere. The 2018 FRQ gave you an interface with the header boolean isValid(String str) and you had to implement classes matching it. The 2023 Sign question, 2024 Scoreboard question, and 2025 SignedText question all required writing complete classes, meaning you wrote the headers yourself, with the correct access modifier, return type, and parameters earning specific rubric points. The rule of thumb is simple. When a header is given, copy it exactly. When you write your own, make every part match what the question describes.
The signature is only the method name plus the parameter types, like countPositives(int[]). The header is the full first line, including the access modifier and return type. Java uses the signature to tell overloaded methods apart, which is why two methods can't share a signature even if their return types differ. The header gives you everything; the signature is the slice Java uses for identification.
A method header is the first line of a method declaration and includes the access modifier, return type, method name, and parameter list.
The return type in the header must match what the body actually returns, and void means the method returns nothing.
The header is not the same as the signature, which is only the method name and parameter types.
On FRQs, you must use the exact header College Board provides, including parameter names and return type, or your code won't earn full credit.
When writing a complete class (like on the 2024 Scoreboard or 2025 SignedText FRQs), choosing correct headers for your methods is part of what's graded.
An overriding method in a subclass must have a header that matches the superclass method's name, parameters, and return type.
It's the first line of a method declaration, listing the access modifier, return type, method name, and parameters. For example, public boolean isValid(String str) from the 2018 FRQ tells you the method is public, returns a boolean, and takes one String parameter.
No. The signature is just the method name and parameter types, which Java uses to distinguish overloaded methods. The header adds the access modifier and return type on top of that.
Yes, every method header needs a return type, even if it's void (meaning the method returns nothing). The one exception is a constructor, whose header has no return type at all, just the access modifier and the class name.
No. When the question gives you a header, you must implement the method exactly as written. Changing the return type, parameter names, or method name will cost you points even if your logic works.
The declaration is the entire method, header plus body. The header is only the opening line that describes how to call the method, while the body between the curly braces contains the actual code.