Consider the following first line from a Java method definition.
public static boolean compute(int n, float x) {

Which one of the following lines could begin a method that legally overloads the above method?

a. private static boolean compute(int n, float x) {
b. public boolean compute(int n, float x) {
c. public static int compute(int n, float x) {
d. public static boolean compute(float n, int x) {
e. public static boolean compute(int x, float n) {

Respuesta :

Answer:

d.

Explanation:

The line of code that would legally overload the above method would be

public static boolean compute(float n, int x) {

This is because in order to legally overload a method the arguments that are passe

ACCESS MORE