Book Image

Java 9 with JShell

By : Gaston C. Hillar
Book Image

Java 9 with JShell

By: Gaston C. Hillar

Overview of this book

The release of Java 9 has brought many subtle and not-so-subtle changes to the way in which Java programmers approach their code. The most important ones are definitely the availability of a REPL, known as JShell, which will make experiments and prototyping much more straightforward than the old IDE-based project-led approach. Another, more subtle change can be seen in the module system, which will lead to more modularized, maintainable code. The techniques to take full advantage of object-oriented code, functional programming and the new modularity features in Java 9 form the main subjects of this book. Each chapter will add to the full picture of Java 9 programming starting out with classes and instances and ending with generics and modularity in Java.
Table of Contents (23 chapters)
Java 9 with JShell
Credits
About the Author
Acknowledgement
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Summary


In this chapter, we learned to refactor existing code to take full advantage of object-oriented code with Java 9. We have prepared the code for future requirements, reduce maintenance costs, and maximized code reuse.

We learned to organize object-oriented code. We created many Java source files. We declared interfaces, abstract classes, and concrete classes in different Java source files. We took advantage of the new modularity features included in Java 9 to create many modules that have dependencies on different modules and exported specific types. We learned to declare modules, compile them to Java bytecode, and launch an application outside of JShell.

Now that you have learned to write object-oriented code in Java 9, you are ready to use everything you learned in real-life desktop applications, mobile apps, enterprise applications, Web Services, and web applications. These applications will maximize code reuse, simplify maintenance, and they will be always ready for future requirements...