Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun startHere() {
- var addResult = calculate(10, 3, { x, y ->
- x + y
- })
- var subtractResult = calculate(10, 3, { x, y ->
- x - y
- })
- ...
- }
- fun calculate(x: Int,
- y: Int,
- equation: (x: Int, y: Int) -> Int): Int {
- return equation(x, y)
- }
Add Comment
Please, Sign In to add comment