AP CSA Method Signatures

Method Signatures in AP CSA: Complete Guide (2025-2026)

Method signatures in AP CSA define the contract of a method — its name, parameter list, and return type — and they are tested on every AP Computer Science A exam in Unit 1 (15–25%) and throughout FRQ writing. The AP exam requires you to write syntactically correct method headers, recognize the difference between a parameter (in the definition) and an argument (the value passed when calling), understand what void means, and know when a method must include a return statement. Getting these right is worth multiple FRQ points every year.

💻 Code Examples — Predict First

Before running each example, write down your prediction. This is the single most effective AP exam study technique.

🤔 Predict the output before running:

Example 1: Method Headers, Parameters, and Arguments
public class Main {
    // Method signature: name=greet, param=String name, return=String
    public static String greet(String name) {
        return "Hello, " + name + "!";
    }
    // void: no return value
    public static void printLine(String text, int times) {
        for (int i = 0; i < times; i++) {
            System.out.println(text);
        }
    }
    public static void main(String[] args) {
        String msg = greet("World");  // "World" is the argument
        System.out.println(msg);
        printLine("---", 3);
    }
}
Running…

Hello, World! / --- / --- / --- — greet() takes a String parameter and returns a String. printLine() takes two parameters and is void (returns nothing). "World" and "---",3 are arguments (the actual values passed).

🤔 Predict the output before running:

Example 2: Method Overloading
public class Main {
    // Overloaded methods: same name, different parameters
    public static int add(int a, int b) {
        return a + b;
    }
    public static double add(double a, double b) {
        return a + b;
    }
    public static int add(int a, int b, int c) {
        return a + b + c;
    }
    public static void main(String[] args) {
        System.out.println(add(2, 3));
        System.out.println(add(2.5, 1.5));
        System.out.println(add(1, 2, 3));
    }
}
Running…

5 / 4.0 / 6 — Three methods named add, each with a different parameter list. Java selects the matching version based on the argument types. This is overloading — same name, different signatures.

🤔 Predict the output before running:

Example 3: Pass-by-Value (Parameters are Copies)
public class Main {
    // Parameters are local copies (pass-by-value)
    public static void doubleIt(int x) {
        x = x * 2;
        System.out.println("Inside: " + x);
    }
    public static void main(String[] args) {
        int n = 5;
        doubleIt(n);
        System.out.println("Outside: " + n);
    }
}
Running…

Inside: 10 / Outside: 5 — Java passes primitives by value. Inside doubleIt(), x is a copy of n. Changing x does NOT change n. After the method call, n is still 5.

❌ Common Pitfalls

These are the mistakes students most often make on the AP CSA exam with method signatures AP CSA parameters return types. Study them carefully.

1
⚠ Writing a non-void method without a return statement

Every code path in a non-void method must return a value. Missing a return statement is a compile error. On AP FRQs, forgetting return at the end of a method is the single most common point lost.

public static int square(int n) {
    int result = n * n;
    // BUG: missing return result;
}
2
⚠ Confusing parameter names with argument names

Parameter names in the method definition are local to that method. Arguments are the values passed in at the call site. They don't need to have the same name. Confusing the two leads to scope errors.

public static void print(String msg) { ... } // 'msg' is param
print(greeting); // 'greeting' is the argument
3
⚠ Calling a void method and expecting a return value

A void method returns nothing. You cannot assign its result to a variable or use it in an expression. Trying to do so is a compile error.

void printX() { System.out.println("X"); }
String s = printX(); // COMPILE ERROR: void has no value
4
⚠ Thinking changes to parameters affect the original variable

Java passes primitives by value — the method receives a copy. Changes inside the method do NOT affect the original variable. This is one of the most misunderstood concepts in Unit 1.

void addTen(int n) { n += 10; }
int x = 5;
addTen(x);
// x is still 5
🎓 AP Exam Tip

On AP FRQs, method headers are worth their own rubric point. The graders check: correct return type, correct method name, correct parameter types and names (in order), and correct access modifiers. Write the header first, then fill in the body.

⚠ Watch Out!

The AP exam uses the term method signature to mean the method name plus its parameter list (types and order). Return type is NOT part of the signature by formal definition, but the exam also tests return type separately. Know both.

✍ Check for Understanding (8 Questions)

Your Score: 0 / 0
1. What is the return type of this method?
public static int countVowels(String s)
2. What is the parameter in this method?
public static double square(double x)
3. What is the difference between a parameter and an argument?
4. What is wrong with this method?
public static int triple(int n) {
 int result = n * 3;
}
5. What is printed?
static void addFive(int x) { x+=5; }
int n=10; addFive(n); System.out.println(n);
6. Which method headers represent valid overloading?
I. public static int add(int a, int b)
II. public static double add(int a, int b)
III. public static int add(double a, double b)
7. Which is the correct way to call this method?
public static String repeat(String s, int n)
8. A method is declared as void. Which statement about it is TRUE?

❓ Frequently Asked Questions

What is a method signature in AP CSA?

A method signature consists of the method name and its parameter list (types and order). For example, add(int, int) is a signature. Return type and access modifiers are not part of the formal signature, but the AP exam tests all parts of the method header.

What is the difference between void and non-void methods?

A void method performs an action but returns no value. A non-void method computes and returns a value of the declared return type. Every non-void method must have a return statement that returns a value of the correct type.

What is method overloading?

Overloading means defining multiple methods with the same name but different parameter lists (different types, number, or order). Java selects the correct version based on the argument types at the call site. Return type alone cannot distinguish overloaded methods.

What does pass-by-value mean for method parameters?

Java passes primitive values by copy. Changes to a parameter inside a method do not affect the original variable in the calling code. The method receives a copy of the value, not a reference to the original variable.

What must every non-void method include?

Every non-void method must include at least one return statement that returns a value of the declared return type. Every possible execution path through the method must reach a return statement. Missing a return statement on any path is a compile error.

TC

Tanner Crow — AP CS Teacher & Tutor

11+ years teaching AP Computer Science at Blue Valley North High School (Overland Park, KS). Verified Wyzant tutor with 1,845+ hours, 451+ five-star reviews, and a 5.0 rating. His AP CSA students score 5s at more than double the national rate.

  • 54.5% of students score 5 on AP CSA (national avg: 25.5%)
  • 1,845+ verified tutoring hours • 5.0 rating
  • Free 1-on-1 tutoring inquiry: Wyzant Profile

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]