Consider the following three method headers L double findAnswer (String a, int b IL double findAnswer Cint b, String a) int findAnswer (String a, int b Which of the following statements is true about their method signatures? Why? a. 1 and i have the same method signature and this signature is different from the method signature of . b. Il and Ill have the same method signature and this signature is different from the method signature of i. c. d、 e· ·ard i" have the same method signature and this signature is different from the method signature of ". l, ll, and III all have the same method signature. l, tt, and ill all have different method signatures.
Previous question

Respuesta :

I and III have the same method signature and this method signature is different from the method signature of II. Hence, C is the correct option.

What is a method signature?

According to the Java language, a method signature is the structure that the programmer has created for a method. The name of a method and a list of its parameters make up the method signature. The same signature cannot be used twice in a class's methods. A compilation error is raised if two methods have the same signature are declared. The return type of a method is not specified in its signature.

The syntax for a method is:

return_type method_name(parameter_list)

I and II in the example question have the same return type, method name, and parameter list.

Since both of these methods have the same signature and the order of the parameter list is irrelevant, means

double findAnswer(String a, int b)

and

double findAnswer(int b , String a)

BOTH ARE SAME

For instance, "double calculate (int a, int b)" is equivalent to double calculate(int b, int a)"

Method II differs from Methods I and III because This method's return type is "int," which means it returns an integer value.

Learn more about Method signature

https://brainly.com/question/29602293

#SPJ4

ACCESS MORE