Appendix A. Miscellaneous language updates

In this appendix, we discuss three other language updates in Java 8: repeated annotations, type annotations, and generalized target-type inference. Appendix B discusses library updates in Java 8. We don’t discuss JDK 8 updates such as Nashorn and Compact Profiles because they’re new JVM features. This book focuses on library and language updates. We invite you to read the following links if you’re interested in Nashorn and Compact Profiles: http://openjdk.java.net/projects/nashorn/ and http://openjdk.java.net/jeps/161.

A.1. Annotations

The annotation mechanism in Java 8 has been enhanced in two ways:

  • You can repeat annotations.
  • You can annotate any type uses.

Before we explain these updates, it’s ...

Get Modern Java in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.