In the program below, which method the line Ais invoking? public class Ambiguousoverloading { public static void main(String[] args) { System.out.println(max(1, 2)); //---------Line A } public static...


In the program below, which method the line Ais invoking?<br>public class Ambiguousoverloading {<br>public static void main(String[] args) {<br>System.out.println(max(1, 2)); //---------Line A<br>}<br>public static double max(int num1, double num2) {<br>if (num1 > num2)<br>//-------Line B<br>return num1;<br>else<br>return num2;<br>}<br>public static double max(double numl, int num2) { //-<br>if (num1 > num2)<br>--------Line c<br>return numl;<br>else<br>return num2;<br>}<br>the main() method<br>the max() method in line B<br>the max() method in line C<br>none of above --an ambiguous invocation error<br>

Extracted text: In the program below, which method the line Ais invoking? public class Ambiguousoverloading { public static void main(String[] args) { System.out.println(max(1, 2)); //---------Line A } public static double max(int num1, double num2) { if (num1 > num2) //-------Line B return num1; else return num2; } public static double max(double numl, int num2) { //- if (num1 > num2) --------Line c return numl; else return num2; } the main() method the max() method in line B the max() method in line C none of above --an ambiguous invocation error

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here