Question: The following program contains a few blanks ( A - E ) . The program is supposed to perform various mathematical operations ( addition ,
The following program contains a few blanks AE The program is supposed to perform various mathematical operations addition subtraction, and multiplication on two numbers. An Operation interface with a method performOperation is used, which takes two integers as parameters and returns the result as an integer. Anonymous classes are used to provide different implementations for various operations. marks Your program should compile and run without any errors, and it should produce the following output: Addition Result: Subtraction Result: Multiplication Result: Please fill in the blanks for the correct execution of the program. Java code:interface Operation int performOperationint a int b; public class Main public static void mainString args Addition Operation Operation addOperation new Operation @Override public int Aint a int b return a b; ; System.out.printlnAddition Result: B; Subtraction Operation Operation subtractOperation new Operation @Override public int performOperationint a int b return a b; ; System.out.printlnC; Multiplication Operation Operation multiplyOperation new Operation @Override public int performOperationint a int b return a b; ; System.out.printlnD;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
