Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the faster LTS of Java 17

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "how to understand the faster LTS of Java 17". In the daily operation, I believe many people have doubts about how to understand the faster LTS of Java 17. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to understand the faster LTS of Java 17"! Next, please follow the editor to study!

Catalogue

Java 17 has been updated, and as a Java programmer for 10 years, there is still a little bit of excitement, and Kotlin's group is also full of new features that discuss Java.

I remember five or six years ago, when we talked about Java 8, which had just entered people's eyes at that time, we still had the expression of "our company is still using Java 6". Now it is a long time since we think about RetroLambda:

Today's Java 8 may be roughly equivalent to Java 6 at that time, and it is already very common in use, even a little out of date: even Android has recently begun to use Java 11 as the default version from the latest version of Android Studio.

Now the release of Java 17 makes Java 11 the second new version of the LTS series, and Java 8 is getting closer and closer-not only that, Java officials want to speed up the pace because they plan to reduce the pace of LTS releases from three years to two years. It seems that the next LTS will be Java 21, which will be released in September 2023.

Back then, it took nearly 10 years for Java to be released from 1.0 (1996) to 1.5 (2004), and then almost 10 years to 1.8 (2014). This has enabled a new version number naming method, known as Java SE 5 and Java SE 8, since 1. 5. Until now, in 2021, whether Java has changed or not, the version number of Java has taken a qualitative leap.

Since the release of Java 9 in September 2017, Java has entered the rhythm of a version every six months. This is a good thing for developers, and developers who like to taste something new can quickly experience the new features of Java in non-LTS versions.

The timing of this change is very subtle because Kotlin 1.0 was released in February 2016, and Google announced Kotlin as the first-level development language of Android in May 2017 (the preferred language was announced at the 2019 IO conference).

Later, we saw that Java is becoming more and more like Kotlin, and Java 10 has var:

Var list = new ArrayList (); / / infers ArrayListvar stream = list.stream (); / / infers Stream

Java 13 has multiline string literals:

String html = ""

Hello, world

""

Java 14 has a switch expression (12 starts previewing):

Int ndays = switch (month) {case JAN, MAR, MAY, JUL, AUG, OCT, DEC-> 31; case APR, JUN, SEP, NOV-> 30; case FEB-> {if (year% 400 = 0) yield 29; else if (year% 100 = 0) yield 28; else if (year% 4 = = 0) yield 29; else yield 28;}}

Java 16 adds pattern matching for type determination (Java 14 starts previewing). The following example is similar to Kotlin's intelligent type conversion in effect:

If (obj instanceof String s) {System.out.println (s.length ());}

There are also data classes (Java 14 starts previewing):

Record Point (int x, int y) {} Point p = new Point; System.out.println (p.x ())

It can be said that Java has come back to life, and developers who like Java no longer have to wait for a lengthy version update.

At this point, the study on "how to understand the faster LTS of Java 17" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report