Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
85 Cards in this Set
- Front
- Back
The ____ translates a program written in a high-level language into the equivalent machine language.
|
compiler
|
|
A program called a(n) ____ translates the assembly language instructions into machine language.
|
assembler
|
|
The source program is written in ____.
|
a high-level language
|
|
The smallest unit of memory inside your computer is the
|
Bit
|
|
____ represent information with a sequence of 0s and 1s.
|
Digital signals
|
|
A(n) ___________________ is a program that converts assembly language or high-level language statements into machine code at the time the program runs.
|
interpreter
|
|
___________________ is usually credited as the inventor of the modern program compiler.
|
Grace Hopper
|
|
If your Java source code program compiles, but displays an error message when you run it, then it must have a:
|
runtime error
|
|
Java __________ programs use windows, buttons, checkboxes and graphics to create the kind of interactive, windowed programs you're used to in the Windows & Mac worlds.
|
GUI applications
|
|
The bytecode for a Java program is saved in the file with the ____ extension.
|
.class
|
|
Changing a Windows program so that it runs on a Mac is called:
|
porting
|
|
Java is an example of a(n)
|
high-level language
|
|
The three main parts of a computer are
|
CPU, Memory, I/O
|
|
In a main method definition, the symbols appearing inside the () are called the:
|
parameter list
|
|
Method definitions should be placed:
|
inside the body of your class
|
|
To create a variable (of either primitive or object type), you must specify which two things?
|
variable type and name
|
|
The class body is where the _______________ and _________________ are defined.
|
attributes and methods
|
|
In this class, instead of putting our "user code" inside the main method in our Java applications, we'll put it inside a method named:
|
run
|
|
The method in the PrintStream class that displays a line of output on the console, and that does not advance the printing "cursor" to the next line is named:
|
print
|
|
The parameter passed to the PrintStream println method:
|
can be of almost any type
|
|
n Java, the __________________ class represents a sequence of 0 or more characters:
|
String
|
|
When you leave a Web page containing a Java applet in your Web browser, the applet's ______________ method will be called.
|
stop()
|
|
In your console program, you used the run() method to display your output. In your Java applet, you'll display your messages in the ______________ method.
|
paint()
|
|
Named constants make your programs clearer and easier to maintain. To create a constant in Java, you must use the modifier ______________ (although you can also use others as well).
|
final
|
|
n a variable definition, the first required element is the:
|
type
|
|
Instance variables:
|
are automatically initialized
|
|
To change the default foreground or background color of your applet, you'll normally use the _____________ method.
|
init();
|
|
Local variables in your program are stored in an area called:
|
the stack-based storage area
|
|
When you leave a Web page containing a Java applet in your Web browser, the applet's ______________ method will be called.
|
stop()
|
|
Named constants make your programs clearer and easier to maintain. To create a constant in Java, you must use the modifier ______________ (although you can also use others as well).
|
final
|
|
When drawing an arc, the starting angle (0) is located at _________ o'clock.
|
3:00
|
|
Procedures allow us to place commonly used actions or calculations in a named block of code and then to simply use that new name instead of repeating the same block of code over and over again. Thus one of the principle reasons for using procedures is:
|
eliminating redundancy
|
|
When you eliminate redundant code by writing a procedure, you'll often find that you have to write even more procedures to remove more. This effect is known as ________________________.
|
stepwise refinement
|
|
The generic term for methods that calculate and reutrn a value is a ____________________.
|
function
|
|
Methods like setBackground() that you can use in your own applets are called ____________________ methods.
|
inherited
|
|
How can a function send a primitive value back to the caller?
|
By using the return statement
|
|
Which modifier is used to specify that a method cannot be used outside a class?
|
private
|
|
Often, when writing a program, a single grammar mistake will lead the compiler to produce a series of misleading error messages. The lesson calls these ________________ errors.
|
cascading errors
|
|
The conditional operator has :
|
three operands
|
|
Two-way selection in Java is implemented using ____.
|
if...else statements
|
|
In a ____ control structure, the computer executes particular statements depending on some condition(s).
|
selection
|
|
Normally, in an object, the methods are _____________, while the fields are ___________.
|
public, private
|
|
To encapsulate a data field inside your OOP class, you'll always use the modifier:
|
private
|
|
The OOP technique used to write programs so that different objects respond differently to the same commands is known as ________.
|
polymorphism
|
|
In object-oriented programming, a(n) ________________ represents the definition—the blueprint if you like—that is used to construct the components of the program.
|
class
|
|
What are the three "faces" of Java?
|
1.Java is a "runtime environment" [Java Virtual Machine]
2.Java is a common class Library 3.Java is a programming language |
|
Probabally the first high-level programming language was designed to allow scientists and engineers to write their own code. That language was named _______________.
|
FORTRAN
|
|
If your Java source code program compiles and runs without displaying an error message, but the output is not what was expected, then your program has a:
|
logic error
|
|
Instance variables will almost always use the modifier _____ when you define them.
|
private
|
|
A(n) ____ is a named memory location that you can use to store a value.
|
variable
|
|
In Java, you use variables of type ____ to store integers, or whole numbers.
|
int
|
|
What character can never appear in an octal integer literal :
|
8
|
|
Which of these must appear outside the body of a class?
|
import
|
|
What is a reserved word in Java?
|
char
|
|
Formal parameters of primitive data types provide ____ between actual parameters and formal parameters.
|
a one-way link
|
|
According to the lesson, a "procedure" call:
|
invokes the procedure
|
|
Procedures and functions are combined in an _______________________ to produce the output you desire.
|
algorithm
|
|
In ____ structures, the computer repeats particular statements a certain number of times depending on some condition(s).
|
looping
|
|
What is an actual parameter?
|
The value passed into a method by a method call
|
|
When a selection statement causes a line of code to be executed, that line of code is called :
|
a branch
|
|
All data must be brought into ____ before a program can manipulate it.
|
main memory
|
|
The early high-level programming language designed around the notation of Lambda Calculus and used to develop early artificial intelligence programs was named ____.
|
LISP
|
|
After you compile your Java source code, the compiler will produce a file
|
with the extension .class
|
|
Which of these words or symbols that can appear in a Java program are identifiers?
|
println
|
|
To create an object in memory (that is to allocate space for the object), you use:
|
the constructor and the new operator
|
|
In Java a variable may contain ...
|
A value or a reference
|
|
The Java integer type that can represent the number of people in this room (40), but not the age of the United States is :
|
byte
|
|
The classes in the Java Class Libraries are organized into families called ____.
|
packages
|
|
The standard Java naming convention for a constant would be:
|
CONVERSION_FACTOR
|
|
To change the default foreground or background color of your applet, you'll normally use the _____________ method.
|
init();
|
|
What is the result of evaluating the mixed-type expression shown here?
"2 + 2 " + 3 + 4 (Place only your answer in the text-box below. Remember to write real numbers like 2.0, and integers like 2. Put quotes around String results.). |
Equals "2 + 2 34"
|
|
What is the result of evaluating the mixed-type expression shown here?
12 / 7 * 4.4 * 2 / 4 (Place only your answer in the text-box below. Remember to write real numbers like 2.0, and integers like 2. Put quotes around String results.). |
Equals 2.2
|
|
Evaluate the following expression.
13 + Math.abs(-7) - Math.pow(2, 3) + 5 (Place only your answer in the text-box below. If the answer is a double, use a decimal like 2.0. If the answer is an integer, just write a plain number like 2.) |
Equals 17.0
|
|
Suppose x = 2 and y = 3. If the statement
x *= y; is executed once, what is the value of y? |
3
|
|
Assume that the following variables have been declared:
String str1 = "Q.E.D."; String str2 = "Arcturan Megadonkey"; String str3 = "Sirius Cybernetics Corporation"; Evaluate the following expression: str2.substring(10, 14) (Place only your answer in the text-box below. If the answer is a String, place it in double quotes; if the answer is an integer, type the number with no decimals; if the answer is a char value, place it in single quotes like 'c'.) |
Equals "egad"
|
|
The generic term for methods that carry out an action is a ____________________.
|
procedure
|
|
public int minimum(int x, int y)
{ int smaller = Math.min(x, y); return smaller; } Which of the following is a valid call to the function defined above? |
int n = minimum(5, 4);
|
|
public String exampleMethod(int n, char ch)
Based on the heading above, what is the return type of the value returned? |
String
|
|
A ______ runs your program and compares its actual output to the output that was expected.
|
unit test
|
|
The first operand used by the conditional operator must have the type :
|
boolean
|
|
After the execution of the following code, what will be the value of num if the input values are 4 (space) 5?
Scanner cin = new Scanner(System.in); int num = cin.nextInt(); if (num > 0) num = num + 10; else if (num >= 5) num = num + 15; |
14
|
|
According to the online lessons, the ________ of an object includes all the information about the object; that is, its attributes or characteristics.
|
state
|
|
The statement
if (x < 0) y = x; else y = 0; can be rewritten using a conditional operator as |
y = (x < 0) ? x : 0;
|
|
Suppose x is 5 and y is 7. What is the value of the following expression?
(x != 7) && (x <= y) |
true
|
|
Suppose that you have the following code:
int sum = 0; int num = 10; if (num > 0) sum = sum + num; else if (num > 5) sum = num + 15; After this code executes, what is the value of sum? |
10
|