Chapter 1 – Getting Started Flashcards
intermediate language
An intermediate language is an abstract programming language used by a compiler as an in-between step when translating a computer program into machine code. Before compiling the program into code for an actual, physical machine, the compiler first translates it into intermediate code suitable for a theoretical, abstract machine. This code is analyzed by the compiler, and if any opportunities for optimization are identified the compiler can perform the optimizations when making the translation into assembly language.
Java byte-code (aka byte-code)
An intermediate language that Java code is translated into. Java bytecode is the instruction set of the Java virtual machine (JVM).
code
A program or a part of a program.
object-oriented programming (OOP)
OOP is a programming methodology that views a program as consisting of objects that interact with each other by means of actions.
object
An object can be a variable, a data structure, a function, or a method, and as such, is a value in memory referenced by an identifier.
method
Actions that an object can take are called the methods of that object.
class
Objects of the same kind or that have the same type. For example, all of the airplanes in a flight simulation game might be of the same class, but they are different instances of that class.
application program
A class with a method named main; when you run the Java program, the run-time system automatically invokes the method named main (that is, it automatically initiates the main action).
applet
A little Java application, applets and applications are almost identical. The difference is that applications are meant to be run on your computer like any other program, whereas an applet is meant to be run from a Web browser, and so can be sent to another location on the Internet and run there. Applets always use a windowing interface, but not all programs with a windowing interface are applets.
application
An application, or application program, is just a regular program. That is, computer software designed to help the user to perform specific tasks.
applet viewer
Although applets are designed to be run via a Web browser, they can also be run via this thing, which is typically meant to be for debugging purposes.
System.out.println
A method in the System.out framework that prints the text in its argument with a new line character (“\n”) attached at the end.
invoking
hen an object performs an action using a method, it is called invoking (or calling) the method.
dot
In a Java program, you write such a method invocation by writing the object followed by a dot (period), followed by the method name, and some parentheses that may or may not have something inside them.
argument
The thing (or things) inside the parentheses is called an argument(s), which provides information needed by the method to carry out its action.
sending a message
Another term for invoking a method is to send a message to the object. With this view, a message is sent to the object (by invoking a method) and in response, the object performs some action (namely, the action taken by the method invoked).
variable int
A variable declaration that contains only integers. So for example, the following code declares the variable var and says that it can only take integer values (say 2, or -7):
> int var;
equal sign / assignment operator
The equal sign (=) is used in Java as the assignment operator. This operator assigns the value to its right to the variable on its left. For example, the following will declare var as a variable integer and assign 7 - 9 to it:
> int var = 7 - 9;
high-level, low-level, and machine languages
A high-level programming language is a language designed to be (relatively) easy for people to write and understand. Machine languages are the languages that computers can directly understand. Machine languages and things like them are called low-level languages.
compiler
A compiler is a program that translates a high-level language program, such as a Java program, into an equivalent low-level-language program.
Java Virtual Machine (JVM)
Bytecode is not the machine language for any particular computer; it is the machine language for a fictitious computer called the Java Virtual Machine (JVM). A Java virtual machine (JVM) is (also) a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode.
interpreter
One of the ways to implement the JVM, an interpreter combines the translation of the bytecode and the execution of the corresponding machine language instructions. The interpreter works by translating an instruction of bytecode into instructions expressed in your computer’s machine language and then executing those instructions on your computer. It does this one bytecode instruction at a time. Thus, an interpreter translates and executes the instructions in the bytecode one after the other, rather than translating the entire bytecode program at once.
Just-In-Time (JIT)
Modern implementations of the JVM use a JIT compiler, which uses a combination of interpretation and compilation. The JIT compiler reads the bytecode in chunks and compiles entire chunks to native machine language instructions as needed. The compiled machine language instructions are remembered—that is, cached—for future use, so the chunk needs to be compiled only once. This model generally runs programs faster than the interpreted model, which always has to translate the next bytecode instruction to machine code instructions.
run command
A command that executes the JVM on the bytecode.
source code
The original code before it is compiled into bytecode.
object code
The bytecode (or really any intermediate language code) generated by a compiler.
.java files
These are files that hold the source code which will be compiled into object code.
javac
This is a command that compiles its argument from a .java file (source code) to a .class file (object code). For example: > javac program.java