Skip to content

rajput-hemant/Functional-Programming-With-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

View Counter   Repo Size

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 / Link
Optional Classes Crash Course Link
Java Streams Tutorial Link

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages