/
akupan2012
/
javacoreStream1.1
Обзор
Документация
Войти
/
akupan2012
/
javacoreStream1.1
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Calculator.java
17 строк
558 B
akupan2012
upload files
25 фев 2026, 21:02
Верифицирован
25 фев 2026, 21:02
c39ee68
Код
Авторство
О чём код?
import java.util.function.*; public class Calculator { static Supplier<Calculator> instance = Calculator::new; BinaryOperator<Integer> plus = (x, y) -> x + y; BinaryOperator<Integer> minus = (x, y) -> x - y; BinaryOperator<Integer> multiply = (x, y) -> x * y; BinaryOperator<Integer> devide = (x, y) -> x / y; UnaryOperator<Integer> pow = x -> x * x; UnaryOperator<Integer> abs = x -> x > 0 ? x : x * -1; Predicate<Integer> isPositive = x -> x > 0; Consumer<Integer> println = System.out::println; }