Java - Polymorphism
Identify the error in the following code snippet related to method overloading:
class Calculator {
int calculate(int a) { return a * 2; }
double calculate(int a) { return a / 2.0; }
}Identify the error in the following code snippet related to method overloading:
class Calculator {
int calculate(int a) { return a * 2; }
double calculate(int a) { return a / 2.0; }
}15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions