Functional Programming
Background:
Java, known for its strong foundation in object-oriented programming (OOP), underwent a profound transformation with the introduction of functional programming concepts in Java 8.
Functional programming represents a different approach to structuring and organizing code compared to traditional OOP.
Functional Programming:
Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.
In a functional programming paradigm:
Functions are first-class citizens: They can be assigned to variables, passed as arguments, and returned as values.
Immutability is emphasized: Once a variable is assigned a value, it typically does not change.
Side effects are minimized: Functions have no observable side effects beyond returning a value.