Glossary

command-line arguments

When you run a program by entering its associated command at a shell prompt, the text that you include after the program name is called the program's command-line arguments. This text is interpreted by the shell as an array of strings that it passes into the program when it runs it. The program can use the values of these command-line arguments to adjust its behavior. For several general examples of command-line arguments adjusting program behavior, refer to the Unix Commands chapter. In Java, this array containing the command-line arguments can be referred to using the main method's String[] args parameter. For more information on how to work with command-line arguments in Java, refer to the Command-Line Arguments chapter.

command-line interface
CLI

The term command-line interface (CLI) refers to programming approaches for accepting user input that require the user to enter lines of text to supply values that impact the behavior of the program. On a Unix system, the shell prompt is an example of a CLI. In Java, a CLI for a program might involve displaying text to the user, reading in user input (e.g., using a Scanner object for standard input), then using that input to change what the program does.

copy constructor

A copy constructor for a class called A is the constructor A(A other); if a class has a copy constructor, then calling it with a reference to some existing object of the class as its parameter should result in the newly constructed object being a copy. The result is not always guaranteed to be a deep copy, so you should always check the constructor documentation and class documentation for more information before you make any assumptions.

instance method

In Java, an instance method is a non-static method of a class. Such methods are called "instance" methods for two reasons: i) they are called using reference variables that refer to specific objects or instances of the class; and ii) they have access to the instance variables associated with that particular instance. To call one instance method from another instance method in the same class, the this keyword can be used as a reference variable that refers to the current object. If you do not use the this keyword to qualify a call to an instance method (e.g., getFoo() instead of this.getFoo()), then Java will automatically qualify it for you, assuming the instance method exists.

instance variable

In Java, an instance variable is a non-static variable of a class that is not local to a method. Such variables are called "instance" variables for two reasons: i) they are called using reference variables that refer to specific objects or instances of the class; and ii) each instance of the class gets its own copy of the variable. Adjusting the value of an instance variable for one object does not impact its value in another object, unless additional code is written to explicitly make that happen. To access an instance variable inside an instance method in the same class, the this keyword can be used as a reference variable that refers to the current object. If you do not use the this keyword to qualify the access (e.g., x instead of this.x), then Java will automatically qualify it for you, assuming the instance variable exists and is not shadowed by a local variable.

local variable

In Java, a local variable is a variable declared inside a code block (such as a method body, loop, or conditional block). Local variables only exist in the block where they are declared. Once the code exits that block, the variable is out of scope.

manual page

A page from the Unix reference manual describing a command, utility, or system interface. Any command on a Unix system can be looked up in the manual by using the man command.

path

A string of characters used to identify the unique location of a file or directory within a file system's hierarchical directory tree (either an absolute path or a relative path).

primitive variable

In Java, a primitive variable is a variable that stores a primitive value directly (rather than a reference to an object). Java defines eight primitive types: byte, short, int, long, float, double, boolean, and char.

reference variable

In Java, a reference variable is a variable that stores a reference to an object (i.e., its memory address) or null.

shell

A program that serves as the primary end-user interface to the services provided by an operating system. On a Unix system, the term shell often refers to a CLI program like Bash or Zsh that manages user–system interactions using a prompt.

shell prompt

A command-line shell manages user–system interactions by prompting users for input, interpreting the input, asking the operating system to perform interpreted actions (e.g., running another program), and displaying related output. While the exact text that is used when a prompt is displayed is often customized, it is common for that text to end with either $ or %. On a Unix system, this is where users enter commands.

standard error

A file or stream to which a program writes or prints its error-related output data. Unless redirected, data written to standard error is sent to the same place as standard output. In Java, System.err refers to a PrintStream for standard error. On most Unix systems, a file or symbolic link that represents standard error exists in the file system, typically at /dev/stderr.

standard input

A file or stream from which a program reads its input data. Unless redirected, data read from standard input is taken from a user's terminal keyboard. In Java, System.in refers to an InputStream for standard input. On most Unix systems, a file or symbolic link that represents standard input exists in the file system, typically at /dev/stdin.

standard output

A file or stream to which a program writes or prints its output data. Unless redirected, data written to standard output is sent to a user's terminal display. In Java, System.out refers to a PrintStream for standard output. On most Unix systems, a file or symbolic link that represents standard output exists in the file system, typically at /dev/stdout.

static method

In Java, a static method is a method associated with a class rather than with individual instances of that class. Static methods are declared with the static modifier and can be invoked directly on the class name without creating an object of that class.

static variable
class variable

In Java, a static variable (or class variable) is a variable declared with the static modifier that is associated with a class rather than with individual instances. All instances of the class share a single copy of a static variable.

A symbolic link or symlink refers to a kind of file that links to (i.e., serves as a shortcut to) another file or directory called the link target. On most Unix systems, the ln -s command can be used to create a symbolic link; refer to the manual page for ln for information. For an example that shows how to use ln to create a symbolic link, refer to the "Hosting the API Documentation Website" section in the Javadoc and API Documentation chapter.

terminal emulator
terminal

A graphical program (such as Terminal and iTerm2 on macOS, or MobaXterm on Windows) that provides a windowed, text-based interface for interacting with a shell.

Unix

A family of computer operating systems that derive from work performed in the 1970s at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others. For more information, refer to the Unix Environment chapter.

variable

A named storage location in computer memory that holds a value or reference of a specific data type.