Chapter 1 Flashcards
A set of written instructions that tells the computer what to do
Computer Program
– The most basic circuitry-level language
– A low-level programming language
Machine Language
Allows you to use a vocabulary of reasonable terms
High-level programming language
A specific set of rules for the language
Syntax
– Similar to English sentences
– Commands to carry out program tasks
Program statements
Translates language statements into machine code
Compiler or Interpreter
– Misuse of language rules
– A misspelled programming language word
Syntax Error
Freeing program of all errors
Debugging
– Also called semantic errors
– Incorrect order or procedure
– The program may run but provide inaccurate output
Logic Errors
Sets of operations executed in sequence
Procedural Programming
Individual operations grouped into logical units
Procedures
Used to create classes, objects from classes, and applications
Object-oriented programs
Blueprints for an objects
Classes
- Polymorphism
- Inheritance
- Encapsulation
Ways that object-oriented programming differs from traditional procedural programming
–Computer simulations
–Graphical user interfaces (GUIs)
Object-oriented programming was used most frequently for these two major types of applications
–Describes objects with common properties
–A definition
–An instance
Class
–Characteristics that define an object
–Differentiate objects of the same class
–The value of attributes is an object’s state
Attributes
Specific, concrete instances of a class
Object
–A self-contained block of program code that carries out an action
–Similar to a procedure
Method
–Conceals internal values and methods from outside sources
–Provides security
–Keeps data and methods safe from inadvertent changes
Encapsulation
–An important feature of object-oriented programs
–Classes share attributes and methods of existing classes but with more specific features
–Helps you understand real-world objects
Inheritance
–Means “many forms”
–Allows the same word to be interpreted correctly in different situations based on context
Polymorphism
- Security features
* Architecturally neutral
Advantages of the Java Programming Language
–Developed by Sun Microsystems
–An object-oriented language
–General-purpose
–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)
Features of the Java Programming Language
Programming statements written in high-level programming language
Source Code
A set of tools used to write programs
Development Environment
–Statements saved in a file
–A binary program into which the Java compiler converts source code
Bytecode
–Checks bytecode and communicates with the operating system
–Executes bytecode instructions line by line within the Java Virtual Machine
Java Interpreter
Programs embedded in a Web page
Applets
–Called Java stand-alone programs
–Console applications
•Support character output
Java applications
- Menus
- Toolbars
- Dialog boxes
Windowed Applications
–Will appear in output exactly as entered
–Written between double quotation marks
Literal String
Pieces of information passed to a method
Arguments
Requires information to perform its task
Method
Refers to the standard output device for a system
System Class
Every Java statement ends with a _________.
semicolon
________ separate classes, objects, and methods.
dots
Method names are always followed by __________.
parentheses
In the statement:
System.out.println(“First Java Application”); ,
“First Java Application” is an example of a ________ __________ and is an _________ to the println method.
literal string,
argument
Everything used within a Java program must be part of a ____________.
class
Define a Java class using any ______ or ________.
name, identifier
–Must begin with one of the following: •Letter of the English alphabet •Non-English letter (such as α or π) •Underscore •Dollar sign –Cannot begin with a digit –Can only contain: •Letters •Digits •Underscores •Dollar signs –Cannot be a Java reserved keyword –Cannot be true, false, or null
Requirements for identifiers
Defines how a class can be accessed
Access Specifier
–A reserved keyword –Means the method is accessible and usable even though no objects of the class exist
static
–Used 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
void