/
Shcod
/
java-hw-core-lambda1
Обзор
Документация
Войти
/
Shcod
/
java-hw-core-lambda1
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/main/java/Calculator.java
17 строк
541 B
Shcod
first commit
06 авг 2026, 08:09
06 авг 2026, 08:09
00baad4
Код
Авторство
О чём код?
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; }