In AP Computer Science A, a constructor header is the first line of a constructor declaration, made up of an access modifier (usually public), a name that exactly matches the class name, and a parameter list. Unlike a method header, it has no return type, not even void.
The constructor header is the top line of a constructor, the part before the curly braces. It has three pieces: an access modifier (almost always public on the AP exam), a name that must match the class name exactly, and a parameter list in parentheses. For a class called Player, the header looks like public Player(String n, int s).
What makes it special is what's missing. A constructor header has no return type. Not int, not String, not even void. That's because a constructor's job, per EK 3.4.A.2, is to set the initial state of a new object. When you call it with new, Java allocates memory for the object and hands back the object reference automatically. The parameters in the header are how outside data gets in to initialize the instance variables. If you accidentally write public void Player(...), Java reads that as a regular method that happens to share the class's name, and new Player(...) will fail because no matching constructor exists.
Constructor headers live in Topic 3.4 (Constructors) in Unit 3: Class Creation, supporting learning objective 3.4.A. The CED expects you to write constructors that initialize every instance variable, and you can't do that if the header is wrong. A bad header means the constructor never runs, or never exists at all.
This matters beyond Unit 3 because every class-design FRQ on the exam starts with you reading or writing class declarations. Knowing instantly that public Temperature(double d, String s) is a constructor while public void temperature(double d, String s) is a method makes you faster and more accurate on both MCQs and FRQs.
Keep studying AP® Computer Science A Unit 3
Attribute (Unit 3)
The header's parameter list exists to feed values into the object's attributes. Per EK 3.4.A.1, attributes are the instance variables that define an object's state, and the constructor body copies parameter values into them.
Method headers (Unit 3)
A method header and a constructor header look almost identical, which is exactly why the exam tests the difference. The method header has a return type and (by convention) a lowercase name; the constructor header has no return type and matches the class name exactly.
Object instantiation with new (Unit 1)
When you write new Player("Ana", 0), Java matches your arguments against the parameter list in a constructor header. The number, order, and types of arguments must line up with the header, or the code won't compile.
Constructor overloading (Unit 3)
A class can have multiple constructors as long as each header has a different parameter list. Java picks which one to run based on which header matches the arguments you pass to new.
Multiple-choice questions love to show you a class with a subtly broken constructor and ask why it "does not work as intended." Two classic traps show up in practice questions on this topic. First, a header written with a return type, like public void Temperature(double d, String s), which turns the constructor into an ordinary method so new Temperature(98.6, "F") won't compile. Second, a correct header followed by a body that re-declares local variables (like String name = n;), which shadows the instance variables and leaves the object's state uninitialized. On FRQs, class-design questions like 2017 FRQ Q2 ask you to write an entire class, and the constructor header is one of the first lines graders check. Get the access modifier, exact class name, and parameter types right, and skip the return type.
A method header always declares a return type (including void) and conventionally uses a lowercase name. A constructor header has no return type at all and its name must match the class name exactly. The classic exam trap is public void ClassName(...), which compiles fine but is a method, not a constructor, so calling new ClassName(...) with those arguments fails.
A constructor header consists of an access modifier, a name identical to the class name, and a parameter list, with no return type.
Adding any return type, even void, to a constructor header turns it into a regular method, so new won't find a matching constructor.
The parameters in the constructor header supply the data used to initialize the object's instance variables (EK 3.4.A.2).
Arguments passed to new must match the header's parameter list in number, order, and type, or the code won't compile.
On class-design FRQs, write the header as public ClassName(parameters) and initialize every instance variable in the body.
It's the declaration line of a constructor, made up of an access modifier (usually public), a name matching the class name exactly, and a parameter list. For example, public Player(String n, int s).
No. A constructor never declares a return type, not even void. If you write public void Player(...), Java treats it as a regular method and new Player(...) will fail to compile.
A method header includes a return type and usually a lowercase name, while a constructor header has no return type and must match the class name exactly. That naming-and-return-type combo is the only way Java tells them apart.
Usually the header is fine but the body re-declares variables, like writing String name = n; inside the constructor. That creates a local variable that shadows the instance variable, so the attribute never gets initialized. Write name = n; instead.
Yes, that's constructor overloading. Each constructor must have a different parameter list in its header, and Java picks the one matching the arguments you pass to new.
Connect this key term to the AP exam workflow: review the course, practice questions, and check related study tools.
Review units, study guides, and course resources.
Check this vocabulary in multiple-choice context.
Apply key concepts in written AP responses.
Estimate the exam score you are working toward.
Review the highest-yield facts before practice.
Put the full course together before test day.