Answer to Question #192394 in Java | JSP | JSF for Phil

Question #192394

7. Given the following code, which statement is correct? Please select "A, B, C, D, or E" as correct option. 


class Sample

{

int add(int x, int y) { return x+y;} // form 1

String add(String x, String y) { return (x+y)+""; } // form 2

double add(int x, int y, int z) { return x+y+z; } // form 3

void add(int x) { System.out.print(x); } // form 4

}


A. form 1 has a conflict with form 2 because parameters in form 2 are different from

parameters in form 1.

B. form 1 has a conflict with form 3 because the number of parameters in form 3 is not equal

to that of form 1.

C. form 2 is the one that will cause conflicts with others because String is not a primitive data

type.

D. form 4 is the one that will cause conflicts because it is the void type.

E. There is no conflict among these four forms.


1
Expert's answer
2021-05-16T12:22:09-0400
Answer:

E. There is no conflict among these four forms.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS