Chapter 1: Creating Java Programs Flashcards

(32 cards)

1
Q

Computer program

A

A set of written instructions that tells the computer what

to do

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Machine language

A

– The most basic circuitry-level language

– A low-level programming language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

High-level programming language

A

Allows you to use a vocabulary of reasonable terms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Syntax

A

A specific set of rules for the language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Program statements

A

– Similar to English sentences

– Commands to carry out program tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Compiler

A

Translates language statements into machine code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Syntax error

A

Misuse of language rules

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Object-oriented programs

A

– Create classes
• Blueprints for an object
– Create objects from classes
– Create applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Object-oriented programming was used most frequently for

three major types of applications

A

– Development of Scientific Applications
– Web, Mobile, Game, and Enterprise Applications
– Graphical user interfaces (GUIs)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Class

A

Describes objects with common properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Objects

A

Specific, concrete instances of a class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Method

A

A self-contained block of program code that carries out an

action

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Encapsulation

A

Conceals internal values and methods from outside

sources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Java

A

– Developed by Sun Microsystems
– An object-oriented language
– General-purpose
– Advantages
• Security features
• Architecturally neutral
– Can be run on a wide variety of computers
– Does not execute instructions on the computer directly
– Runs on a hypothetical computer known as a Java Virtual
Machine (JVM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Source code

A

Programming statements written in high-level

programming language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Development environment

A

A set of tools used to write programs

17
Q

Bytecode

A

– Statements saved in a file
– A binary program into which the Java compiler converts
source code

18
Q

Java interpreter

A

– Checks bytecode and communicates with the operating
system
– Executes bytecode instructions line by line within the Java
Virtual Machine`

19
Q

Applets

A

Programs embedded in a Web page

20
Q

Java applications

A

Called Java stand-alone programs
– Console applications
We will write these types of applications this semester.
• Support character output

– Windowed applications
• Menus
• Toolbars
• Dialog boxes

21
Q

Literal string

A

Written between double quotation marks

22
Q

Arguments

A

Pieces of information passed to a method

23
Q

System class

A

Refers to the standard output device for a system

24
Q

static

A
Means the method is accessible and usable even though 
no objects of the class exist
25
void
– Use in the main() method header – Does not indicate the main() method is empty – Indicates the main() method does not return a value when called – Does not mean that main() doesn’t produce output
26
WHAT TO TYPE: Compiling a Java class
javac First.java
27
Compile-time error
``` – The compiler detects a violation of language rules – Refuses to translate the class to machine code ```
28
Parsing
Compiler divides source code into meaningful portions
29
Run-time error
– Not detected until execution | – Often difficult to find and resolve
30
Line comments
* Start with two forward slashes (//) | * Continue to the end of the current line
31
Block comments
* Start with a forward slash and an asterisk (/*) | * End with an asterisk and a forward slash (*/)
32
package
A group of classes