Kurs i

Java 8

Java version 8, inför tre begrepp som i grunden förändrar ditt sätt att designa programkoden inuti metoderna/funktionerna av en klass. Dessa tre är: Lambda Expressions, Data Streams samt Asynchronous Computation.

Under två intensiva kursdagar lär du dig allt du behöver veta för att komma igång med dessa tre begrepp och kunna använda dem i dina egna Java applikationer.

Denna kurs vänder sig till dig som idag arbetar med en tidigare version av Java och önskar snabbt sätta sig in i alla nyheter i språket och standardbiblioteket.

Detta får du lära dig på kursen
  • Skriva Java program med lambda uttryck
  • Kunna skriva program med data streams/pipeline kedjor mha Stream<T>
  • Kunna skriva program med asynkron exekvering mha CompletableFuture<T>
  • Kunna använda de nya klasserna för datum, tider och intervall
Innehåll

Functional Interfaces

Functional interfaces is a syntactic foundation for lambda expressions covered in the next chapter. Here we discuss what it is and other syntactic enhancements of interfaces in Java to support the introduction of lambda expressions.
  • Functional interface
  • Default method
  • Method and constructor reference
  • Functional interfaces in the Java API

Lambda Expressions

Lambda expressions (aka closures or anonymous functions) is a much welcome addition to the Java syntax and the fundamental building block on virtually almost everything else we cover in this course.
  • What is a lambda expression (aka closure)
  • Basic syntax
  • Dealing with free variables
  • Limitations of the type system
  • Currying

Java API Class Update

Of course, have all the collection classes been augmented to support lambdas. Here we walk you through the changes both for collection classes and others as well.
  • Review of the most important container classes
  • Lambda oriented methods in the collection classes
  • Optional
  • The Java 8 API explorer

Data Streams

Java has always been about data-structures and its organization. What you did inside the method of a class was left to your discretion, until now. Say hello, to data streams. After you have seen the merits of writing functional code as a pipeline chain of filters, transformations and aggregators, you will never go back. Trust us on this.
  • What is stream and pipeline
  • Stream sources
  • Bounded and unbounded streams
  • Number streams
  • Parallel streams
  • Filters and matchers
  • Mappers and aggregators
  • Numeric aggregators
  • Understanding collect()
  • Understanding reduce()
  • Using the Collectors utility
  • Special filters
  • Using Map and FlatMap
  • Sorting and shuffling
  • The Java 8 Streams Cheat Sheet

Date and Time

First we had java.util.Date, with its millennium bug problem. Then came java.util.Calendar as a mere overkill and then nothing for two decades. Finally, java.time has arrived as a proper solution for dealing with time, date, duration and time-zones.
  • Clock
  • ZoneId
  • Instant
  • LocalTime och LocalDate
  • Factory methods
  • Builders

File I/O

Overview of java.nio classes. Most of them was introduced before Java 8, but many has then been updated to support lambdas ans streams processing.
  • Concepts and abstractions in java.nio
  • File systems support
  • Understading Path
  • Useful utility classes, such as Files and Paths

Threaded Computation

Short overview of how the threading support has evolved in Java and a motivator and background for the next chapter.
  • Execution models
  • What is a thread
  • Concurrency problems to bw aware of
  • Thread-safe data-structures introduced in Java 5
  • Using thread-pools (aka Executors)
  • Usage of interface Callable<T>
  • Understading and using Future<T>
  • Fork/Join concurrency introduced in Java 7
  • Using jSoup to scrape HTML pages and different ways of running several scraping tasks in parallel

Asynchronous Computation

Asynchronous computation has over the last half-decade emerged as the most important computation paradigm, because of how efficient it handles system resources and scales way beyond threaded computation. In this chapter you will learn all you need to know in order to write you own asynchronous computation chains using the new CompletableFuture<T> class. We will also show you how to combine Stream<T> with CompletableFuture<T>.
  • Limitations of threaded computation
  • What is asynchronous computation
  • Limitations of Future<T>
  • Using call-back functions
  • Limitations of the call-back model
  • The boomerang effect
  • Interface CompletionStage<T>
  • Class CompletableFuture<T> and what it does
  • Time capped computation using a promise
  • Creating an async stage using supplyAsync()
  • Asynchronous stage chains
  • Delayed computation
  • Transforming data in a stage chain using thenApply()
  • Composing chains using thenCompose()
  • Combining chains using thenCombine()
  • Waiting the completion of many stage chains
  • Using Stream<T> to assemble partial results in an async stage chain
  • Transforming and handle exceptions
  • Running async stages in a thread pool, aka parallel computation
  • Understanding the *Async() suffix

Overview of Java 9

Java version 9 has been delayed several times. In the mean-time, here is an overview of what to expect and how to run the beta version already today.
  • The current release day ;-/
  • How to download and install the beta version
  • The Java REPL, now at last
  • Collection factories to help creating collection literals
  • The new HTTP/2 compatible client
  • I/O streams utilities
  • Understanding modules in Java 9 and why it's a good thing
  • The module descriptor
SnabbFakta
Namn
Java 8
Längd
2 dagar
Nivå
Intermediate
Målgrupp
Java programmerare
Förkunskaper
Aktiva kunskaper i Java programmering
Teknisk miljö
  • Java JDK, senaste versionen
  • En texteditor för programutveckling
  • JetBrains IntelliJ IDEA, senaste versionen
  • Windows
Dela
Relaterade Kurser
KursLängdNivå
Java Basics4 dagar Beginner
Java Intermediate3 dagar Intermediate
Java Threads and Concurrent Programming2 dagarAdvanced
Java for REST Web Services Apps2 dagarAdvanced
Schemalagd Kurs

Pris

15 000 kr + moms

Vi ger 20% rabatt för tillkommande deltagare från samma företag vid samma kurstillfälle. Läs mer om vår samma-företags-rabatt.

Aktuella KursDatum
StartdatumPlats
2017-08-17 Stockholm City
2017-09-07Stockholm City
2017-09-28Stockholm City
2017-10-12Stockholm City
2017-11-09Stockholm City
2017-12-18Stockholm City
Företagsintern Kurs

Om du beställer en företagsintern kurs kommer vi till er och håller kursen i era lokaler. Priset bestäms av vår prismodell och baseras på antalet kursdagar, antalet deltagare, samt i förekommande fall resa och logi.

Prisexempel för NN deltagare

PPP + moms

Antal
Område

Läs mer om vår prismodell och beställningsvillkor.