Signature

In Java, a signature is the combination of a method or constructor's name and its parameter list (the number, types, and order of parameters). The return type, access modifier, and parameter names are NOT part of the signature, which is why overloaded constructors must differ in their parameters.

Verified for the 2027 AP Computer Science A examLast updated June 2026

What is Signature?

A signature is Java's way of uniquely identifying a method or constructor. It consists of exactly two things, the name and the parameter list. For the parameter list, what matters is the number of parameters, their types, and their order. The parameter names themselves don't count, and neither does the return type or the access modifier like public or private.

Signatures are what make overloading possible. A class can have three constructors all named Rectangle because each one has a different parameter list, like Rectangle(), Rectangle(int len), and Rectangle(int len, int w). When you write new Rectangle(5, 3), the compiler matches your arguments against each constructor's signature and picks the one that fits. Think of a signature like a fingerprint. Two constructors can share a name, but no two can share a fingerprint, or Java won't compile your class.

Why Signature matters in AP Computer Science A

Signatures live at the heart of writing classes in AP CSA, the skill where you design constructors and methods from a specification. Every overloaded constructor question, every "which constructor gets called?" trace, and every class-writing FRQ depends on you reading parameter lists correctly. If you can't tell Rectangle(int len) apart from Rectangle(int len, int w), you can't predict program behavior or write a class that compiles. The concept also explains a rule that trips people up constantly. Two methods that differ only in return type are not legally overloaded, because the return type isn't part of the signature.

How Signature connects across the course

Constructor Overloading (Unit 3)

Constructor overloading is the signature concept in action. A class gets multiple constructors only because each has a unique parameter list, so understanding signatures is literally the prerequisite for overloading.

Default Constructor (Unit 3)

The default constructor has the simplest possible signature, the class name with an empty parameter list. Java only writes it for you if you define zero constructors yourself, so adding Rectangle(int len) means new Rectangle() stops compiling unless you add the no-arg version back.

New Keyword (Unit 1)

Every new call is a signature lookup. When you write new Rectangle(5, 3), Java matches your two int arguments against the available constructor signatures and runs the one that fits, which is why argument order and type matter so much.

Method Overriding (Unit 3)

Overriding is the flip side of overloading. Overloading requires different signatures in the same class, while overriding requires the same signature in a subclass. Keeping that contrast straight earns easy MCQ points.

Is Signature on the AP Computer Science A exam?

On multiple choice, signature questions come in two flavors. The first asks you to define it directly, like "what does a constructor signature NOT include?" (answer: the return type, access modifier, and parameter names). The second gives you a class like Rectangle with three overloaded constructors and asks which one runs for a given new call, which means matching argument types and counts to signatures. On the free response, the class-writing question hands you a specification and expects your constructor and method headers to match it exactly. The 2025 FRQ Q2 (SignedText) used "signature" to mean a text signature appended to a string, not the Java concept, but writing that complete class still required getting the constructor's signature right. Wrong parameter types or order in an FRQ class costs you points even if your logic inside is perfect.

Signature vs Method header

The header is the full first line of a method, including the access modifier, return type, name, and parameter list, like public int getArea(int len, int w). The signature is only the name plus the parameter list, so getArea(int, int). This distinction is exactly what MCQs probe when they ask what a signature does NOT include. If two methods share a signature, they conflict, even if their return types differ.

Key things to remember about Signature

  • A signature is the method or constructor name plus its parameter list, meaning the number, types, and order of parameters.

  • The return type, access modifier, and parameter names are NOT part of the signature.

  • Overloaded constructors must each have a unique signature, which in practice means a different parameter list since all constructors share the class name.

  • Two methods that differ only in return type have the same signature, so Java rejects them as illegal overloading.

  • When you call new Rectangle(5, 3), the compiler picks the constructor whose signature matches your arguments' types, count, and order.

  • Overloading means different signatures in the same class, while overriding means the same signature redefined in a subclass.

Frequently asked questions about Signature

What is a signature in AP Computer Science A?

A signature is the combination of a method or constructor's name and its parameter list, including the number, types, and order of parameters. It's how Java tells overloaded constructors and methods apart within a class.

Does a method signature include the return type?

No. The signature is only the name and parameter list. That's why public int getValue() and public double getValue() can't coexist in one class; they have identical signatures despite different return types.

What's the difference between a signature and a method header?

The header is the whole first line, like public int area(int len, int w), while the signature is just area(int, int). MCQs love asking what the signature does NOT include, and the answer is the access modifier, return type, and parameter names.

Can two constructors have the same signature?

No, that's a compile-time error. Since all constructors share the class name, each one must have a different parameter list, like Rectangle(), Rectangle(int len), and Rectangle(int len, int w).

Do parameter names matter in a signature?

No, only the types, count, and order of parameters matter. Rectangle(int len, int w) and Rectangle(int a, int b) have the exact same signature, so they would conflict in the same class.