162
pages
English
Ebooks
2019
Vous pourrez modifier la taille du texte de cet ouvrage
Obtenez un accès à la bibliothèque pour le consulter en ligne En savoir plus
Découvre YouScribe en t'inscrivant gratuitement
Découvre YouScribe en t'inscrivant gratuitement
162
pages
English
Ebooks
2019
Vous pourrez modifier la taille du texte de cet ouvrage
Obtenez un accès à la bibliothèque pour le consulter en ligne En savoir plus
Publié par
Date de parution
20 septembre 2019
Nombre de lectures
4
EAN13
9789389328615
Langue
English
Poids de l'ouvrage
1 Mo
Publié par
Date de parution
20 septembre 2019
Nombre de lectures
4
EAN13
9789389328615
Langue
English
Poids de l'ouvrage
1 Mo
Java 9.0 to 13.0 New Features
Learn, implement and migrate to new version of Java.
by
Mandar Jog
FIRST EDITION 2019
Copyright © BPB Publications, India
ISBN: 978-93-89328-608
All Rights Reserved. No part of this publication may be reproduced or distributed in any form or by any means or stored in a database or retrieval system, without the prior written permission of the publisher with the exception to the program listings which may be entered, stored and executed in a computer system, but they can not be reproduced by the means of publication.
LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY
The information contained in this book is true to correct and the best of author’s & publisher’s knowledge. The author has made every effort to ensure the accuracy of these publications, but cannot be held responsible for any loss or damage arising from any information in this book.
All trademarks referred to in the book are acknowledged as properties of their respective owners.
Distributors:
BPB PUBLICATIONS
20, Ansari Road, Darya Ganj
New Delhi-110002
Ph: 23254990/23254991
MICRO MEDIA
Shop No. 5, Mahendra Chambers,
150 DN Rd. Next to Capital Cinema,
V.T. (C.S.T.) Station, MUMBAI-400 001
Ph: 22078296/22078297
DECCAN AGENCIES
4-3-329, Bank Street,
Hyderabad-500195
Ph: 24756967/24756400
BPB BOOK CENTRE
376 Old Lajpat Rai Market,
Delhi-110006
Ph: 23861747
Published by Manish Jain for BPB Publications, 20 Ansari Road, Darya Ganj, New Delhi-110002 and Printed by him at Repro India Ltd, Mumbai
Dedicated to
My wife (Tejaswini), son (Ojas)
About the Author
Mandar Jog is a passionate Java trainer. From last over 15 years, he has worked for different organizations as a Java trainer. He has global certifications like Sun Certified Java Programmer (SCJP) & Sun Certified Web Component Developer (SCWCD). As a trainer, his main areas of expertise are Java, J2EE (Spring, Hibernate). Over the years, he has delivered more than 500 training sessions on technologies like Core Java, Web Technologies, Big Data, Spring Boot, Angular, among others.
Along with training, Mandar is connected with different organizations and institutions for designing the curriculum of computer engineering. He also conducts Train-the-Trainer sessions for many colleges to connect them with cutting-edge technologies.
“New concepts are always tough in the beginning”. He believes in this, and makes sure to make complex concepts simpler for his students. Along with retail trainings, he also trains corporate clients for induction and lateral trainings.
He has also been a part of many best-selling books on Java as a technical reviewer published by international publications.
In his leisure time he likes to be with music. Playing the synthesizer and listening to music are his hobbies.
Acknowledgement
To begin with, I would like to thank the team of BPB Publications for giving me the opportunity to write this book. Their support throughout this book was phenomenal.
I would also like to thank my wife, Tejaswini. She is my better half in every sense. She has been my source of inspiration while writing this book. Her suggestions really made a lot of difference to this book.
Special thanks to my loving son, Ojas. He desperately wanted to get this book published, so that I could spend more time with him.
Lastly, I would like to thank my parents and friends who have always supported and trusted me.
– Mandar Jog
Preface
From the day of its first release, Java has been one of the most reliable programming languages for developers. Initially though, it was launched as just another object-oriented language, in later stages it became more popular because of its capabilities in efficient web programming components. Java became one of the first choices for the developers to develop desktop and web applications. But, the team of Java has always been on its toes to update the API of Java, so that it can serve the developers in efficiently creating software components for complex business needs. These updates were launched in terms of major and minor versions by Java. During this process, Java has launched 13 major versions, from JDK1.0 to JDK13.0. Each version comes with different recommendations to cater to different needs. Learning such updates for each version is obviously not a simple task. The objective of this book is to familiarize the reader with all the changes Java proposed in the different versions. The book covers version updates from JDK9.0 to very recent JDK13.0. The book contains examples to show the working of the concepts introduced in different versions. Effort has been taken to make sure that most of the concepts are explained with simple examples so that everybody can understand the working of the same.
Chapter 1 talks about the journey of Java. It describes how Java has evolved, right from its birth to the current version. It gives an overview of all the versions in terms of new features which were introduced in every version.
Chapter 2 is dedicated to Java9. It mainly focuses on the modular programming concepts of Java9 and how it is better than the traditional approach of package-centric application development.
Chapter 3 discusses the updates in JDK10. It discusses local variable type inference, time-based release versioning, among others. It also discusses the modifications in the garbage collection for this version.
Chapter 4 discusses the updates done in JDK11. It discusses different concepts like ZGC, Nashorn JavaScript Engine, along with other concepts like nest-based access control, No-op garbage collector, etc.
Chapter 5 discusses how to migrate prejava9 applications to the newer versions. It also discusses how to work with jlink, and the concept of multi-release jar files.
Chapter 6 talks about an important tool--jshell. It discusses the different commands and feedback modes which are used in jshell.
Chapter 7 focuses on the concept of reactive programming in Java, as well as about the different concepts like subscriber, publisher and back pressure.
Chapter 8 discusses the updates in Java12. It talks about the Shenondaoh garbage collector, microbenchmark suit and abortable mixed collections for G1.
Chapter 9 discusses the updates in Java13. It talks about how to free up the unused memory in ZGC. Along with this, it also talks about the text blocks and modified switch expressions.
Downloading the code bundle and coloured images:
Please follow the link to download the Code Bundle and the Coloured Images of the book:
https://rebrand.ly/5d390
Errata
We take immense pride in our work at BPB Publications and follow best practices to ensure the accuracy of our content to provide with an indulging reading experience to our subscribers. Our readers are our mirrors, and we use their inputs to reflect and improve upon human errors if any, occurred during the publishing processes involved. To let us maintain the quality and help us reach out to any readers who might be having difficulties due to any unforeseen errors, please write to us at :
errata@bpbonline.com
Your support, suggestions and feedbacks are highly appreciated by the BPB Publications’ Family.
Table of Contents
1. Insight of Versioning
Introduction
Structure
Objective
Project Green: the beginning
Versions of Java
Time-based release version
Conclusion
Questions
2. What’s New in Java 9
Introduction
Structure
Objective
Project Jigsaw
Compact profiles
Java Platform Module System
Explore module
Module types
Listing JDK modules
Java module graph
Declaring the module
requires
exports
uses
provides…with
Download Java 9
Create your first Java module
Compiling module
Executing module
Working with multiple modules
Working with Eclipse
Working with Apache NetBeans
Java Enhancement Proposals (JEP) in JSE 9.0
JEP 102: Process API updates
JEP 110: HTTP/2 Client (Incubator)
JEP 158: unified JVM logging
JEP 213: Milling Project Coin
JEP 214: remove GC combinations deprecated in JDK 8
JEP 220: modular run-time images
JEP 221: new Doclet API
JEP 222: JShell (Read-Eval-Print Loop)
JEP 238: Multi release JAR file
JEP 248: make G1 the default garbage collector
JEP 251: multi-resolution images
JEP 254: compact Strings
JEP 282: jlink, the Java linker
JEP 289: deprecate Applet API
JEP 291:deprecate the concurrent mark sweep garbage collector
Conclusion
3. Understanding JDK 10 - Step towards JDK 11
Introduction
Structure
Objective
Downloading JDK 10
JEP 286: local variable type inference
Compile time safety
Polymorphism
Working with collections & arrays
Working with traditional for loop
Working with for each loop
Working with Java streams
Working with anonymous class
Working with try-with-resources
JEP 296: consolidate the JDK forest into a single repository
JEP 304: Garbage collector interface
JEP 307: Parallel full GC for G1
JEP 310: Application class data sharing
JEP 313: Remove the native-header generation tool (javah)
JEP 314: Additional Unicode language-tag extensions
JEP 316: Heap allocation on alternate memory devices
JEP 317: experimental Java-based compiler
JEP 319: root certificates
JEP 322: time-based release versioning
API
System properties
Removed features and options
Deprecated features and options
Conclusion
Questions
4. Dive in JDK 11
Introduction
Structure
Objective
Downloading JDK11
JEP 181: nest-based access control
Change in the reflective access
JEP 309: Dynamic class-file constants
JEP 315: Improve Aarch64 intrinsic
JEP 318: Epsilon: no-op garbage collector
How to implement no-op GC
Allocation
Barriers
JEP 320: remove the Java EE and CORBA modules
JEP 321: HTTP client (standard)
JEP 323: local-variable syntax for lambda parameters
JEP 324: Key agreement with Curve25519 and Curve 448
API changes
JEP 327: Unicode 10
JEP 328: Flight reco