GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Java Tutorial
  • Advanced Java
  • Interview Questions
  • Exercises
  • Examples
  • Quizzes
  • Projects
  • Cheatsheet
  • DSA in Java
  • Java Collection
  • Introduction
  • Java Lambda Expression with Collections
  • Lambda Expression Variable Capturing
  • Create a Thread using Lambda Expressions

This view

  • Original page
  • New address

GeezerVison is showing www.geeksforgeeks.org — Java 8 Features - Complete Tutorial - GeeksforGeeks

geeksforgeeks
search icon
  • Courses
  • Tutorials
  • Interview Prep
  • Java Tutorial
  • Advanced Java
  • Interview Questions
  • Exercises
  • Examples
  • Quizzes
  • Projects
  • Cheatsheet
  • DSA in Java
  • Java Collection

Java 8 Features Tutorial

Last Updated : 11 Sep, 2026

Java 8 is one of the most important releases in the history of Java. Released on March 18, 2014, it introduced several major language and library enhancements that made Java programming more concise, expressive, and suitable for functional-style programming. The most significant Java 8 features include Lambda Expressions, Functional Interfaces, Method References, Stream API, the Optional class, the new Date and Time API, and enhancements to interfaces and collections.

  • Introduction of the Stream API for efficient data processing.
  • A new Date and Time API for better handling of time and date operations.
  • Default and static methods in interfaces for greater flexibility.

Lambda Expressions

A Lambda Expression is used to provide the implementation of a functional interface. It enables you to write cleaner and shorter code.

  • Introduction
  • Lambda Expressions Parameters
  • Java Lambda Expression with Collections
  • Lambda Expression Variable Capturing
  • Create a Thread using Lambda Expressions
  • Serialization of Lambda Expression
  • Block Lambda Expressions

Functional Interfaces

An interface that contains only one abstract method is known as a functional interface; however, there is no restriction on the number of default and static methods that can be included within a functional interface.

  • Introduction
  • Consumer Interface
  • BiConsumer Interface
  • Predicate Interface
  • Function Interface
  • Supplier Interface

Method Reference

Method reference is a shorthand notation of a lambda expression to call a method.

  • Introduction
  • Method References
  • Converting ArrayList to HashMap using Method Reference

Streams

Stream API is introduced in Java 8 and is used to process collections of objects with the functional style of coding using the lambda expression. So to understand what stream API is, you must have knowledge of both lambda and functional interfaces.

  • Introduction
  • Implement Filter Function using Reduce
  • Stream API Filters
  • Parallel vs Sequential Stream
  • Array to Stream
  • Print Elements of a Stream
  • Convert an Iterable to Stream
  • Convert an Iterator to Stream
  • Convert Stream to Set
  • Convert a Set to Stream

Comparable and Comparator

Comparable and Comparator are interfaces used to order objects. They are particularly useful in sorting operations and collections that require natural ordering. Here we will learn about Comparable and Comparator in depth.

  • Comparable vs Comparator
  • Comparator Interface
  • Sort an Array of Triplet using Java Comparable and Comparator
  • Sort LinkedList using Comparable
  • Sort HashSet Elements using Comparable Interface
  • Sort LinkedHashMap by Values using Comparable Interface
  • Sort LinkedHashMap by Keys using Comparable Interface

Optional Class

Optional is a container object that may or may not contain a non-null value. It can be used to make the absence of a value explicit and reduce some common null-handling problems.

  • Introduction
  • ofNullable() Method
  • ifPresentOrElse() Method
  • orElseGet() Method
  • filter() Method
  • hashCode() Method
  • toString() Method
  • equals() Method
  • stream() Method

Date/Time API

Java 8 introduced the java.time API, which provides modern classes for working with dates, times, time zones, offsets, periods, and related operations. It provides a more comprehensive API than the older date and calendar classes.

  • Introduction
  • LocalDateTime Class
  • MonthDay Class
  • OffsetTime Class
  • OffsetDateTime Class
  • Clock Class
  • ZonedDateTime Class
  • ZoneOffset Class
  • Year Class
  • YearMonth Class
  • Period Class

Other Java 8 Features

JaJava 8 also introduced several enhancements to interfaces, collections, and functional interfaces. These features extend the capabilities of existing Java APIs and make functional-style programming easier.

Java 8 Interface and Collection Enhancements

Java 8 introduced default and static methods in interfaces and added several useful methods to collection-related APIs.

  • Default Methods
  • Static method
  • Override Default Method
  • forEach() method
  • ArrayDeque removeIf() method

Functional Interfaces – Unary Operator

Unary operator interfaces represent operations that accept one argument and return a value of the same type.

  • LongUnaryOperator Interface
  • IntUnaryOperator Interface
  • DoubleUnaryOperator Interface
  • UnaryOperator Interface

Functional Interfaces – Consumers and Suppliers

Java provides specialized functional interfaces for primitive types to avoid unnecessary boxing and unboxing.

  • LongConsumer Interface
  • ObjLongConsumer Interface
  • ObjIntConsumer Interface
  • ObjDoubleConsumer Interface
  • DoubleConsumer
  • IntSupplier Interface
  • BooleanSupplier Interface
  • LongSupplier Interface
  • DoubleSupplier Interface

Functional Interfaces – Functions and BiFunctions

Java 8 also provides specialized function interfaces for primitive values and functions that accept two arguments.

  • LongFunction Interface
  • IntFunction Interface
  • ToDoubleFunction Interface
  • DoubleFunction Interface
  • ToIntFunction Interface
  • LongToIntFunction Interface
  • ToLongFunction Interface
  • LongToDoubleFunction Interface
  • ToLongBiFunction Interface
  • ToIntBiFunction Interface
  • ToDoubleBiFunction Interface
Comment

Explore

    Basics
    • Introduction3 min read
    • Variables2 min read
    • Data Types7 min read
    • Operators7 min read
    • Decision Making5 min read
    • Methods7 min read
    • Arrays7 min read
    • Strings5 min read
    OOP & Interface
    • Introduction6 min read
    • Constructors6 min read
    • Encapsulation3 min read
    • Inheritance8 min read
    • Polymorphism5 min read
    • Abstraction5 min read
    • Interfaces8 min read
    Collections
    • Collection class9 min read
    • Collection Interface5 min read
    • List Interface8 min read
    • Set Interface5 min read
    • Queue Interface5 min read
    • Map Interface in Java6 min read
    • Iterator4 min read
    Advance Java Concepts
    • Exception handling6 min read
    • Java Multithreading Tutorial3 min read
    • Synchronization in Java9 min read
    • File handling6 min read
    • Method References3 min read
    • Java 8 Stream Tutorial7 min read
    • Memory Management4 min read
    • Garbage Collection in Java6 min read
    • Networking6 min read
    • JDBC5 min read
    Practice Java
    • Interview Questions15+ min read
    • Programs6 min read
    • Practice Problems5 min read
    • Quiz1 min read
    • Project Ideas15+ min read
    Courses
    • Java Backend Course2 min read
    • Placement 360 Course2 min read
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.