Practice what’s new in Java

You have read about the new features that have arrived in Java world but didn’t have the opportunity to learn them yet? I have a challenge for you.

What’s new in Java world

I won’t describe what’s new in Java world because this article is h…


This content originally appeared on DEV Community and was authored by

You have read about the new features that have arrived in Java world but didn't have the opportunity to learn them yet? I have a challenge for you.

What's new in Java world

I won't describe what's new in Java world because this article is hard to surpass:

How to practice it?

But reading about what's new is not enough.

Alas, your project at work may be stuck with Java 11 or even Java 8.

In a previous article, I shared the tip that if you want to learn more about a programming language - or here its evolution - you should write unit tests about them.

This is exactly what I've started to do here:

GitHub logo jmfayard / java16-playground

Life is too short for Java 8

java16-playground

Life is too short for Java 8

Playground project demonstrating the new features from Java 8 to Java 16

See article: Practice what's new in Java

Contributions welcome, see open issues

Reference: https://dev.to/awwsmm/20-reasons-to-move-on-from-java-8-1dio




If you look in the src/main/test folder, you will find snippets like this one:

public class RecordJava14 {
    record Employee (String name, int age, String department) {
    }

    @Test
    void createRecord() {
        var patrik = new Employee("Patrick", 36, "Marketing");
        assertThat(patrik.toString()).isEqualTo("Employee[name=Patrick, age=36, department=Marketing]");
        assertThat(patrik.name()).isEqualTo("Patrick");

        var clone = new Employee("Patrick", 36, "Marketing");
        assertThat(clone).isEqualTo(patrik);
    }
}

This gives you a view of the features of modern Java that are already covered:

java16-playground_–_README_md__java16-playground_

Your challenge

If you want to learn more about modern Java, I challenge you to pick one of the remaining issues and implement it.

https://github.com/jmfayard/java16-playground/issues

(of course, you can also create a new issue)

Issues_·_jmfayard_java16-playground


This content originally appeared on DEV Community and was authored by


Print Share Comment Cite Upload Translate Updates
APA

| Sciencx (2021-07-08T19:18:04+00:00) Practice what’s new in Java. Retrieved from https://www.scien.cx/2021/07/08/practice-whats-new-in-java/

MLA
" » Practice what’s new in Java." | Sciencx - Thursday July 8, 2021, https://www.scien.cx/2021/07/08/practice-whats-new-in-java/
HARVARD
| Sciencx Thursday July 8, 2021 » Practice what’s new in Java., viewed ,<https://www.scien.cx/2021/07/08/practice-whats-new-in-java/>
VANCOUVER
| Sciencx - » Practice what’s new in Java. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/07/08/practice-whats-new-in-java/
CHICAGO
" » Practice what’s new in Java." | Sciencx - Accessed . https://www.scien.cx/2021/07/08/practice-whats-new-in-java/
IEEE
" » Practice what’s new in Java." | Sciencx [Online]. Available: https://www.scien.cx/2021/07/08/practice-whats-new-in-java/. [Accessed: ]
rf:citation
» Practice what’s new in Java | | Sciencx | https://www.scien.cx/2021/07/08/practice-whats-new-in-java/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.