GithubHelp home page GithubHelp logo

shekhargulati / java8-the-missing-tutorial Goto Github PK

View Code? Open in Web Editor NEW
1.6K 1.6K 375.0 2.82 MB

Java 8 for all of us

Home Page: https://shekhargulati.com/

License: MIT License

Java 99.31% JavaScript 0.69%
java-8 java-tutorial lambda missing-tutorial tutorial

java8-the-missing-tutorial's Introduction

Java 8: The Missing Tutorial

Java 8 is not a new topic anymore. There are many good books published on it. Still I meet many Java developers unaware of the power of Java 8. The goal of this microbook is to cover some of the most important Java 8 features and how they can help developers in their day to day programming. This is based on my 7 days with Java 8 blog series.

Contributing to the Java 8: The Missing Tutorial

Please contribute if you see an error or something that could be better! Raise an issue or send me a pull request to improve. Contributions of all kinds, including corrections, additions, improvements, and translations, are welcome!

Table of Contents


You can follow me on twitter at https://twitter.com/shekhargulati or email me at [email protected]. Also, you can read my blogs at http://shekhargulati.com/

Analytics

java8-the-missing-tutorial's People

Contributors

asif31iqbal avatar blakehawkins avatar gavinfish avatar mastersimon avatar ordepdev avatar pyjaime avatar shekhargulati 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  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

java8-the-missing-tutorial's Issues

Confusing at Static Factory Methods

Hi,

At https://github.com/shekhargulati/java8-the-missing-tutorial/blob/master/01-default-static-interface-methods.md, I saw:

Calculator calculator = new BasicCalculator();
int sum = calculator.add(1, 2);

BasicCalculator cal = new BasicCalculator();
int difference = cal.subtract(3, 2);

Oh no! Users of the API are not coding to Calculator interface -- instead, they are coding to its implementation. Your API didn't enforce users to code to interfaces, as the BasicCalculator class was public.

But I don't know why you say "Oh no". Can you explain more?

Regards,
Huka.

jdk8 implements the same default method signature of different interface now got error

https://github.com/shekhargulati/java8-the-missing-tutorial/blob/master/01-default-static-interface-methods.md

Rule 3: Otherwise, the class has to call the desired implementation unambiguously

Running with
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (Zulu 8.23.0.3-macosx) (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (Zulu 8.23.0.3-macosx) (build 25.144-b01, mixed mode)
will got error:
Error:(7, 8) java: class com.example.Test inherits unrelated defaults for test() from types com.example.TestAInterface and com.example.TestBInterface

public interface TestAInterface {
    default String test() {
        System.out.println("in a");
        return "a";
    }
}

public interface TestBInterface {
    default String test() {
        System.out.println("in b");
        return "b";
    }
}

public class Test implements TestAInterface, TestBInterface {
}
class App {
    public static void main(String[] args) {
        Test a = new Test();
        a.test();
    }
}

Translation into Chinese

Hi, shekhargulati!

I am really like your posts in java8-the-missing-tutorial. I want to translate them into Chinese so that more people can learn about them. I will add your name and links to this repository. Can you give me a chance?

[Improvement] "10-nashorn.md" - Add objects manipulation examples (extend/merge)

For my project I need to extend objects, so normally I use external libraries for example jQuery.extend(...) or lodash.merge(...):

// test "lodash" lib
var test = {id: 1};
var test2 = _.merge({}, test, {name: "Bob"});
print(JSON.stringify(test2));

Do you know a Java-native way to extend objects? for example using ScriptObjectMirror.putAll(...)

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.