
Vinayak P. answered 04/16/20
Senior Software Engineer specializing in Java
Hi Rgtrg,
You need to write a function and define some interfaces that will handle the functions that need to be defined.
Rgtrg R.
asked 04/14/20Code a static inner class called FunctionComposition that is parameterized by three type parameters. This
class should have no methods, and no constructor. It should only have a single BiFunction called
composition, which takes in two functions and provides their composition as the output function.
Function composition should be consistent with the types - if there is a function f: char -> String,
and another function g: String -> int, the output of composition should be a function h: char ->
int. For example, if f concatenates a char some number of times (say, 'b' yields "bb", 'c' yields "ccc",
'd' yields "dddd", etc.), and g converts a string to its length, then composition(f, g) should output a
function that maps 'z' to 26.
Vinayak P. answered 04/16/20
Senior Software Engineer specializing in Java
Hi Rgtrg,
You need to write a function and define some interfaces that will handle the functions that need to be defined.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.