Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “ACC_PUBLIC (0x0001)
indicates that the class is public and can be accessed from other packages.”
A block of code is set as follows:
public final class AccessSample { private int value; public AccessSample(int value) { this.value = value; }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
public class ConstantPoolSample { private String message = "Hello, Java!"; // String literal stored // in the constant pool public static void main(String[] args) { ConstantPoolSample sample = new ConstantPoolSample(); System.out.println(sample.message); // Accessing the field // with a symbolic reference } }
Any command-line input or output is written as follows:
javac Animal.java javap -verbose Animal
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “It’s worth mentioning that alternatives such as InstantOn from Open Liberty also exist”
Tips or important notes
Appear like this.