Book Image

Java 9 Cookbook

By : Mohamed Sanaulla, Nick Samoylov
Book Image

Java 9 Cookbook

By: Mohamed Sanaulla, Nick Samoylov

Overview of this book

<p>Java is an object-oriented programming language. It is one of the most widely accepted languages because of its design and programming features, particularly in its promise that you can write a program once and run it anywhere.</p> <p>This cookbook offers a range of software development examples in simple and straightforward Java 9 code, providing step-by-step resources and time-saving methods to help you solve data problems efficiently. Starting with the installation of Java, each recipe addresses a specific problem, with a discussion that explains the solution and offers insight into how it works.</p> <p>We cover major concepts such as Project Jigsaw and various tools that will enable you to modularize your applications. You will learn new features in the form of recipes that will make your applications modular, secure, and fast.</p>
Table of Contents (22 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Using HTML5 in Javadocs


In this recipe, you will learn about the usage of HTML5 tags in the Javadoc comments in Java 9.

Getting ready

There are plenty of sources on the Internet that describe HTML5 tags. Since Java 9, one can use any one of them in Javadoc comments.

HTML5 provides better browser compatibility. It is also more mobile-friendly than its predecessor, HTML4. But to take advantage of HTML5, one has to specify the -html5 parameter during Javadoc generation. Otherwise, only HTM4-style comments will continue to be supported.

How to do it...

Here is an example of the HTML5 tags used for Javadoc comments:

/**
<h2>Returns the weight of the car.</h2>
<article>
  <h3>If life would be often that easy</h3>
  <p>
    Do you include unit of measurement into the method name or not?
  </p>
  <p>
    The new signature demonstrates extensible design of an interface.
  </p>
</article>
<aside>
  <p> A few other examples could be...