?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Difficult

Overloading a Method

APCSA-WEZYTT

Consider the following class.

public class A 
{
    public static double output(String s)
    {
        return s.length() / 2.0;
    }

    public static String output(int i)
    {
        return "answer: " + i * 100;
    }

    public static int output (double d)
    {
        return (int) (d * 10);
    }
}

What is the output from the following statement in a client class?

System.out.println(A.output(A.output(A.output("giraffe"))));
A

70

B

4000

C

answer: 3.5

D

answer: 3000

E

answer: 3500