Answer to Question #192390 in Java | JSP | JSF for Bill

Question #192390

5. Given the following code, which form of the "add" method will be called for execution?


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

boolean add(boolean x, boolean y) { return x; } //form4

public static void main(String[] args)

{

Sample s1 = new Sample();

System.out.print(s1.add(3.2, 4.1));

}

}


A. form 1

B. form 2

C. form 3

D. form 4

E. None of the options


1
Expert's answer
2021-05-15T13:50:48-0400

C. form 3


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