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

Question #192393

6. Given the following code, which form of the "add" method can generate 3.24.1 as output? Please select "A, B, C, D, or E" as correct option. 


class Sample

{

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

float add(float x, float y) { return (x + y); } //form2

double add(double x, double y) { return (x + y); } //form3

char add(char x, char y) {return (char)((int) x + (int) y);} //form4

String add(String x, String y) { return (x + y); } //form5

..........

}


A. form 1

B. form 2

C. form 3

D. form 4

E. form 5


1
Expert's answer
2021-05-15T19:32:56-0400

Answer : B,C


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