Computer Applications

In a calculator which Java feature allows multiple methods named calculate() for the different operations?

  1. abstraction
  2. inheritance
  3. encapsulation
  4. polymorphism

OOP Intro Java

2 Likes

Answer

polymorphism

Reason — Polymorphism in Java allows multiple methods with the same name but different parameters (method overloading). In a calculator, different operations like addition, subtraction, etc., can be implemented using methods with the same name calculate() but with different parameter lists, which is a feature of polymorphism.

Answered By

1 Like


Related Questions