GithubHelp home page GithubHelp logo

adoptopenjdk / lambda-tutorial Goto Github PK

View Code? Open in Web Editor NEW
108.0 40.0 127.0 246 KB

Exercises to learn lambda syntax + the Streams API from the upcoming JDK 8 release

License: GNU General Public License v2.0

Java 100.00%

lambda-tutorial's Introduction

Lambda Tutorial Build Status

A set of exercises to teach use of Java 8 lambda syntax, and the Streams API.

To follow the exercises:

  • fork and clone the repository
  • ensure you have a correctly configured, JDK8+ build
    • Maven can help generate configuration for your favourite IDE
    • ensure your cloned project, particularly the class ConfigureYourLambdaBuildOfJdk compiles and runs correctly
  • navigate to the first exercise, Exercise_1_Test (tests are in src/test/java, in the package org.adoptopenjdk.lambda.tutorial)
  • read background information in the JavaDoc, and follow instructions, making the test pass
  • to find solutions check out different branches of the project. Two flavours of solutions are available: what it might have looked like before JDK 8, and what it might look like after JDK 8. Those are in branches solutions-prejava8 and solutions-postjava8 respectively.

Exercises

  1. Internal vs External Iteration (the forEach method)
  2. Filtering and Collecting
  3. Mapping
  4. Method References
  5. Default methods on interfaces

lambda-tutorial's People

Contributors

grundlefleck avatar karianna avatar mdasberg avatar neomatrix369 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lambda-tutorial's Issues

Exercise 1, Test 3 should be more similar to Test 2

Exercise_1_Test has one test case which requires Shape#toString method, and the following test case expects the use of Shape#getColor to build the result string. The latter test case should just use Shape#toString, for consistency.

Exercise_5_Test.java fails to compile

The source files for the following classes seem to be missing: StarRating, UserRatedMusicLibrary, CloudScrobblingMusicLibrary, UserRatedLocalFilesystemMusicLibrary.

The following imports do not resolve:

import org.adoptopenjdk.lambda.tutorial.exercise5.musicplayer.StarRating;
import org.adoptopenjdk.lambda.tutorial.exercise5.musicplayer.UserRatedMusicLibrary;
import org.adoptopenjdk.lambda.tutorial.exercise5.thirdpartyplugin.CloudScrobblingMusicLibrary;
import org.adoptopenjdk.lambda.tutorial.exercise5.thirdpartyplugin.UserRatedLocalFilesystemMusicLibrary;

Update to more recent JDK state

This is a great learning project.

However I’ve noticed a lot of the content is focused on either EA or earlier versions of IDEs (in a Wiki) or compatible JDK.

Given latest versions of JDK (as if request 14-15) and with new release schedule, suggest

(1) updating JDK references in readme and source where applicable
(2) for IDE setup wiki pages changes since JDK 8 is readily supported if not mandatory now with recent IDE versions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.