Computer Applications
In a calculator which Java feature allows multiple methods named calculate() for the different operations?
- abstraction
- inheritance
- encapsulation
- 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
The earth spins on its axis completing one rotation in a day. The earth revolves around the sun in 365 days to complete one revolution. What is the Java concept depicted in the given picture?

- Array
- Condition
- Nested loop
- While loop
In the following method prototype to accept a character, an integer and return YES or NO, fill in the blank to complete the method prototype.
public ............... someMethod(char ch, int n)- boolean
- String
- int
- double
Assertion (A): The result of the Java expression 3 + 7/2 is 6.
Reason (R): According to the hierarchy of operators in Java, addition is done first followed by division.
- (A) is true and (R) is false.
- (A) is false and (R) is true.
- Both (A) and (R) are true and (R) is a correct explanation of (A).
- Both (A) and (R) are true and (R) is not a correct explanation of (A).
What is the type of parameter to be given for the method parseInt()?
- double
- String
- char
- int