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 (A-E). 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.[2.5*4=10 marks] Your program should compile and run without any errors, and it should produce the following output: Addition Result: 30Subtraction Result: 10Multiplication Result: 200 Please fill in the blanks for the correct execution of the program. Java code:interface Operation { int performOperation(int a, int b);} public class Main { public static void main(String[] args){// Addition Operation Operation addOperation = new Operation(){ @Override public int ----A----(int a, int b){ return a + b; }}; System.out.println("Addition Result: "+----B----(20,10)); // Subtraction Operation Operation subtractOperation = new Operation(){ @Override public int performOperation(int a, int b){ return a - b; }}; System.out.println(----C----(20,10)); // Multiplication Operation Operation multiplyOperation = new Operation(){ @Override public int performOperation(int a, int b){ return a * b; }}; System.out.println(----D----(20,10)); }}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!