Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rajput-hemant/functional-programming-with-java


https://github.com/rajput-hemant/functional-programming-with-java

functional-programming java

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

![View Counter](https://komarev.com/ghpvc/?username=Functional-Programming-With-Java&label=View%20Counter&color=red&style=flat)   ![Repo Size](https://img.shields.io/github/repo-size/rajput-hemant/Functional-Programming-With-Java?color=blue)

# Functional-Programming-With-Java

Functional Programming is a paradigm that takes complex computation as the evaluation of mathematical functions (lambda expressions) which makes the code easier to understand, less complex, and reasonable to test. The original Java programming language is based on Von Neumann architecture.

## Concepts in functional programming

Functional Programming works on four concepts in Java 8:

- **Lambda Expressions:** Lambda expressions lets a function (method) pass as an input parameter for another function. Lambda function comprises two parts separated by a **_`‘->’. Parameter -> { function body }`_**

- **Functional interfaces:** A functional interface has one abstract method ie. a method that has not been instantiated.

- **Optional class:** Optional classes are container classes that include classes that either present (contains object) or not present (empty). Use java.util.Optional to create an optional class.

- **Stream API:** Stream API processes a collection of objects that involves a process containing a data source, perform intermediate operations, and get a result.

---

## _Is Java a functional language?_

**_Java is not_** a functional language but imperative. But to tone down certain complexities, with the advent of Java 8, a few aspects of functional programming were added. Also, not all concepts of functional programming solve real problems.

---

## Resources Used:

| Resource | URL |
| ------------------------------ | -------------------------------------------------------------------------- |
| Functional Programming in Java | [Link](https://youtu.be/VRpHdSFWGPs) / [Link](https://youtu.be/rPSL1alFIjI)|
| Optional Classes Crash Course | [Link](https://www.youtube.com/watch?v=1xCxoOuDZuU) |
| Java Streams Tutorial | [Link](https://www.youtube.com/watch?v=Q93JsQ8vcwY) |

---

### Tutor: [Amigoscode](https://www.youtube.com/c/amigoscode) / [freeCodeCamp.org](https://www.youtube.com/c/Freecodecamp)