Question: Simple Lambda Program ( 2 5 ) Given the following functional interface: interface Powers { double power ( double a , double b ) ;
Simple Lambda Program
Given the following functional interface:
interface Powers
double powerdouble a double b;
Write a simple class LambdaPowers with a main method that implements the interface so that it returns the result of raising he forst variable to the power of the second.
The interface should be implemented two ways. e creates a function without a return statement. e creates a function with a return statement inside the labda expression. For each case read in the inputs.
Write simple output statements to demonstrate the two functions.
Sample inputoutput:
Please enter two values as type double:
Without return the power is
Please enter two values as type double:
With return the power is
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
