Exam 1 Flashcards
(89 cards)
Algorithm
A step-by-step description of how to accomplish a task.
Program
A list of instructions to be carried out by a computer.
Hardware
The physical components that make up a computer: central processing unit, or CPU, memory (often called random access memory, or RAM, hard disk as a larger permanent storage
Software
Computer programs are collectively called software. The primary piece of software running on a computer is its operating system. An operating system provides an environment in which many programs may be run at the same time; it also provides a bridge between those programs, the hardware, and the user (the person using the computer). The programs that run inside the operating system are often called applications.
Digital
Based on numbers that increase in discrete increments, such as the integers 0, 1, 2, 3, etc
Modern computers are digital because everything that is stored on the computer is stored as a sequence of integers
Binary Number
A number composed of just 0s and 1s, also known as a base-2 number.
Program Execution
The act of carrying out the instructions contained in a program.
Compiler
A program that translates a computer program written in one language into an equivalent program in another language (often, but not always, translating from a high-level language into machine language).
executable
A compiler that translates directly into machine language creates a program that can be executed directly on the computer, known as an executable.
native compilers
We refer to such compilers as native compilers because they compile code to the lowest possible level (the native machine language of the computer).
Java bytecodes
Instead of compiling into machine language, Java programs compile into what are known as Java bytecodes. One set of bytecodes can execute on many different machines. These bytecodes represent an intermediate level: They aren’t quite as high-level as Java or as low-level as machine language. In fact, they are the machine language of a theoretical computer known as the Java Virtual Machine (JVM).
Java Virtual Machine
A theoretical computer whose machine language is the set of Java bytecodes.
To actually execute a Java program, you need another program that will execute the Java bytecodes. Such programs are known generically as Java runtimes, and the standard environment distributed by Oracle Corporation is known as the Java Runtime Environment (JRE).
Java Runtime
A program that executes compiled Java bytecodes.
Most people have Java runtimes on their computers, even if they don’t know about them. For example, Apple’s Mac OS X includes a Java runtime, and many Windows applications install a Java runtime.
Java
A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, dynamic language.2
Java Class Libraries
The collection of preexisting Java code that provides solutions to common programming problems.
platform independent
Java is extremely platform independent; unlike programs written in many other languages, the same Java program can be executed on many different operating systems, such as Windows, Linux, and Mac OS X.
The Java Programming environment (steps):
Type in a program as a Java class.
Compile the program file.
Run the compiled version of the program.
File extensions
The Java program files that you create must use the extension .java. When you compile a Java program, the resulting Java bytecodes are stored in a file with the same name and the extension .class.
Integrated Development Environments, or IDEs
Most Java programmers use what are known as Integrated Development Environments, or IDEs, which provide an all-in-one environment for creating, editing, compiling, and executing program files. Some of the more popular choices for introductory computer science classes are Eclipse, IntelliJ, NetBeans, jGRASP, DrJava, BlueJ, and TextPad. Your instructor will tell you what environment you should use.
Console Window
A special text-only window in which Java programs interact with the user.
The console window is a classic interaction mechanism wherein the computer displays text on the screen and sometimes waits for the user to type responses. This is known as console or terminal interaction. The text the computer prints to the console window is known as the output of the program. Anything typed by the user is known as the console input.
Class
A unit of code that is the basic building block of Java programs. Oracle has established the convention that class names always begin with a capital letter, which makes it easy to recognize them. Java requires that the class name and the file name match, so this program must be stored in a file called Hello.java.
basic form of a Java class
public class {
...
}
class header
The first line of the class is known as the class header. The word public in the header indicates that this class is available to anyone to use.
Method
Simple methods are like verbs: They command the computer to perform some action. Inside the curly braces for a class, you can define several different methods. At a minimum, a complete program requires a special method that is known as the main method. It has the following syntax: public static void main(String[] args) { ; ; ... ; }