This is because the short value is automatically casted to an integer when passed for integer literal. Therefore, the following declaration will also handle a short argument: public StringBuilder append (int i) {…}
B, C, D, and E are incorrect.
B is incorrect because the append declaration that includes an int is included in the StringBuilder class.
C is incorrect because the append declaration that includes a long is included in the StringBuilder class.
D is incorrect because the append declaration that includes a float is included in the StringBuilder class.
E is incorrect because the append declaration that includes a double is included in the StringBuilder class.
|