Rgtrg R.

asked • 04/14/20

Code this java question fast please

Code 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.


1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.