rowdysites.msudenver.edurowdysites.msudenver.edu/.../zybooksjavaglossarydani…  · web viewthis...

23
ZyBooks Java Programming – Glossary by Daniel L’Episcopo, December, 2017 Section 1.1 - Programming 1) Computer Program: Consists of instructions that a computer can execute and run properly. Section 1.2 – A First Program 1) Code: The textual representation of a program 2) Line: A row of text 3) Main Method: A method is a list of statements 4) Braces “{“ and “}”: Denote a list of statements 5) Statement: A program instruction 6) Semicolon “;”: End each statement with a semicolon 7) Compiler: A tool that converts an assembly language into a low-level machine instructions (binary) Section 1.3 – Basic Output 1) String Literal: Text that is in double quotes “” 2) System.out.print: This construct supports printing to the console in Java 3) System.out.println: Prints out a blank line after printing to the console Section 1.4 – Basic Input 1) Scanner: A text parser that can read numbers, words, or phrases from an input source such as a keyboard. Section 1.5 – Comments and Whitespace 1) Comment: Text added to code by a programmer, intended to be read by humans to have a better understanding of the code 2) Single-Line Comment: Uses the // symbols By Daniel L’Episcopo Page 1

Upload: vubao

Post on 26-Mar-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

ZyBooks Java Programming – Glossaryby Daniel L’Episcopo, December, 2017

Section 1.1 - Programming

1) Computer Program: Consists of instructions that a computer can execute and run properly.

Section 1.2 – A First Program

1) Code: The textual representation of a program2) Line: A row of text3) Main Method: A method is a list of statements4) Braces “{“ and “}”: Denote a list of statements5) Statement: A program instruction6) Semicolon “;”: End each statement with a semicolon7) Compiler: A tool that converts an assembly language into a low-level machine

instructions (binary)

Section 1.3 – Basic Output

1) String Literal: Text that is in double quotes “”2) System.out.print: This construct supports printing to the console in Java3) System.out.println: Prints out a blank line after printing to the console

Section 1.4 – Basic Input

1) Scanner: A text parser that can read numbers, words, or phrases from an input source such as a keyboard.

Section 1.5 – Comments and Whitespace

1) Comment: Text added to code by a programmer, intended to be read by humans to have a better understanding of the code

2) Single-Line Comment: Uses the // symbols3) Multi-Line Comment (Block Comment): Uses the /* and */ symbols4) Whitespace: Black spaces between items within a statement, and to blank lines

between statements.

Section 1.6 – Errors and Warnings

By Daniel L’Episcopo Page 1

Page 2: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

1) Syntax Error: Violates a programming language’s rules on how symbols can be combined to create a program.

2) Compile-Time Error: Another name to call a syntax error3) Logic Error, Runtime Error, or Bug: An error that occurs when a program runs.4) Warning: Doesn’t stop the compiler from creating an executable program, but indicates

a possible logic error.

Section 1.7 – Additional Practice

Practice

Section 1.8 – Computers and Programs

1) Bits: Binary digits that are represented with a “1” value and as a “0” value (on and off)2) Processors: Execute a list of desired calculations3) Instruction: A single calculation that a processor may execute4) Memory: A circuit that can store 0s and 1s in each of a series of thousands of addressed

locations5) Program/Application/App: A programmer-created sequence of instructions6) Machine Instructions: Instructions represented as 0s and 1s7) Executable Program: A sequence of machine instructions together8) High-Level Languages: Support programming using formulas or algorithms9) Compilers: Programs that translate high-level language programs into executable

programs. 10) Bytecode: Computer object code that is processed by a program, usually referred to as

virtual machine, rather than by the “real” computer machine, the hardware processor.11) Virtual Machine: Executes the instructions in the bytecode

Section 1.9 – Computer Tour

1) Input/Output Devices: Components such as a screen, keyboard, mouse, microphones, speakers, prints, and USB interfaces. I/O devices are commonly called, peripherals.

2) Storage: A disk (AKA hard drive) that stores files, program files, songs/films, or office documents. These disks are non-volatile, meaning they retain their contents when the power goes off.

3) Memory/RAM (Random-Access Memory): Temporarily holds data read from storage, and is designed such that any address can be accessed much faster than a disk. RAM is volatile, losing its contents when the power goes off.

4) Byte: 8 bits.5) Processor/CPU (Central Processing Unit): It runs the computer’s programs, reading and

executing instructions from memory, preforming operations, and reading/writing data from/to memory.

By Daniel L’Episcopo Page 2

Page 3: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

6) Operating System: Allows a user to run other programs and which interfaces with the many peripherals.

7) Cache: A processor containing a small amount of RAM on its own chip8) Clock: A processor’s instructions execute at a range governed by the processor’s clock,

which ticks at a specific frequency. 9) Transistors: Tiny switches that can be triggered by electric signals. They are the basic

building block of microchips, and roughly define the difference between electric and electronic devices.

10) Integrated Circuit (IC): Transistors that were integrated into a single chip.11) Moore’s Law: The doubling of IC capacity roughly every 18 months

Section 1.10 – Language History

1) C: Was the dominant programming language in the 1980s, and was created by Brian Kernighan and Dennis Ritchie at AT&T Bell Labs, in 1978.

2) C++: This was the improvement upon C’s high level language. Bjarne Stroustrup published a book describing a C-based language that supports object-oriented programming, in 1985.

3) Java: James Gosling and a team of engineers at Sun Microsystems developed Java with the intent of creating a language whose executable could be ported to different processors, with the first public release in 1995.

Section 1.11 – Problem Solving

1) Problem Solving: Creating a methodical solution to a given task

Section 1.12 – Salary Calculation

Practice

Section 2.1 – Variables (int)

1) Variable: Represents a memory location used to store data2) Declares: When you tell a variable that it holds an integer3) Address: What the program uses to recall a variable in the memory location

Section 2.2 – Assignments

1) Assignment Statement: Assigns the right-side item’s current value into the variable on the left side.

2) Expression: it may be a number, a variable, or a simple calculation that uses operators like +, -, *, /, %, and ().

By Daniel L’Episcopo Page 3

Page 4: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

Section 2.3 – Identifiers

1) Identifier: A name created by a programmer for an item like a variable or method. An identifier must be a sequence of letters (a-z letters, A-Z, _, and digits (0-9) and must start with a letter!

2) Reverse Word: A word that is part of the language, like int, short, or double. You can’t use a reverse word as an identifier!

3) Case Sensitive: Upper case and lower case letters differ. Ex. NumCats is different from NumCats.

4) Naming Conventions: Styles that are defined by their company, team, teacher, etc.5) Lower Camel Case: abuts multiple words, capitalizing each word except the first, as in

numApples.

Section 2.4 – Arithmetic Expressions

1) Literal: A specific value in a code like “2”. However, commas are not allowed!2) Operator: A symbol for a built-in language calculation like + for addition.3) Arithmetic Operators: built into the language itself like: + (addition), - (subtraction), *

(multiplication), / (division), and % (modulo i.e. remainder).4) Unary Minus: - is used as a negative.5) Divide-By-Zero Error: This occurs at a runtime if a divisor is 0, causing a program to

terminate.6) Precedence Rules: The compiler evaluated an expression’s arithmetic operators using

the order of standard mathematics. PEMDAS!7) Compound Operators: A shorthand way to update a variable, such as “userAge += 1”,

being shortcut for “userAge = userage + 1”. Other compound operators include -=, *=, /=, and %=.

Section 2.5 – Floating-Point Numbers (Double)

1) Double: This declared variable stores a floating-point number. Ex 12.68.2) Floating-Point Literal: A number with a fractional part, even if that fraction is 0, as in

1.0, 0.0, or 99.573.3) Floating-Point Divide-By-Zero: This occurs at runtime if a divisor is 0.0.

Section 2.6 – Constant Variables

1) Final/Constant Variable/Final Variable: The complier will report an error if a later statement tries to change that variable’s value.

Section 2.7 – Grade Calculation

Practice

By Daniel L’Episcopo Page 4

Page 5: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

Section 2.8 – Using Math Methods

1) Math Class: A class that you can import that comes with 30 math operations to use for any calculations.

2) Method: Is a list of statements that can be executed by referring to the method’s name.3) Argument: An input value to a method appears between parentheses.4) Method Call: This is invoking a method. Such as, when a method executed and returns a

new value.

Section 2.9 – Type Conversions

1) Type Conversion: A conversion of one data type to another, such as an int to a double.2) Implicit Conversion: The compiler automatically preforms several common conversions

between int and double types.3) Type Casting:

Section 2.10 – Binary

1) Binary Number: Each memory location is composed of bits (0s and 1s), a processor stores a number using base 2.

2) Decimal Number: A number that is in base 10 each digit in a position of a number can have an integer value ranging from 0 – 9 (ten possibilities).

Section 2.11 – Characters

1) Char: a variable with the char type can store a single character, like the letter m or the symbol %.

2) Character Literal: Is surrounded with single quotes, as in ‘m’ or ‘%’.3) ASCII: It is an early standard for encoding character as numbers.4) Escape Sequence: It is a two-character sequence starting with \ that represents a special

character. Ex: ‘\n’ represents a newline character.

Section 2.12 – String Basics

1) String: A sequence of characters. A string literal uses double quotes as in, “Julia”.2) Scnr.nextLine(): It reads all user text on the input line, up to the newline character

resulting from the user pressing ENTER, into the stringVar.3) Object: Consists of some internal data items plus operations that can be performed on

that data.

Section 2.13 – Integer Workflow

By Daniel L’Episcopo Page 5

Page 6: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

1) Overflow: Occurs when the value being assigned to a variable is greater than the maximum value the variable can store. Ex – x > 2 billion

Section 2.14 – Numeric Data Types

1) Long: Is used for integers that are expected to exceed 2 billion.

Section 2.15 – Random Numbers

1) Random: This class provides methods that return a random integer in a range 0 to 2^32.

Section 2.16 – Reading API Documentation

1) Oracle’s Java API Specification: Provides detailed documents describing how to use classes.

2) API: Also known as API, short for application programming interface.3) Packages: A group of related classes4) Class Overview: The first part of the documentation provides an overview of the class,

describing the class’ functionality and providing examples of how the class is commonly used in a program.

5) Constructor Summary: Provides a list and brief description of the constructors that can be used to create objects of the class.

6) Method Summary: Provides a list and brief description of all methods that can be called on objects of the class. The Java documentation only lists the public methods that a program may use.

7) Constructor and method details: Lastly, the documentation for a class provides a detailed description of all constructors and methods for the class.

Section 2.17 – Debugging

1) Debugging/Troubleshooting: The process of determining and fixing the cause of a problem in a computer program.

Section 2.18 – Additional practice: Health Data

Practice

Section 2.19 – Style Guidelines

1) Style Guide: A specific type of style for writing code.2) K&R Style: For braces and indents is name after C language creators Kernighan and

Ritchie.

By Daniel L’Episcopo Page 6

Page 7: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

3) Stroustrup Style: For braces and indents is named after C++ language creator Bjarne Stroustrup.

Section 2.20 – Java Example

Practice

Section 3.1 – If-else

1) Branching: Directs a program to execute either one statement group or another, depending on an expression’s value.

2) Braces: Surround a branch’s statements representing a group

Section 3.2 – Relational & Equality Operators

1) Relational Operator or Equality Operator: An if-else expression commonly involves these.

2) Boolean: A value meaning either true or false.

Section 3.3 – Multiple if-else Branches

1) Nested if-else: A branch’s statements can include any valid statements, including another if-else statement.

Section 3.4 – Logical Operators

1) Logical Operator: treats operands as being true or false, and evaluates to true or false (AND, OR, NOT).

2) Boolean Data Type: Only for variables that should store only values true or false. 3) Bitwise Operators: For integral operand types, such as an int, the single character

versions.

Section 3.5 – Switch Statements

1) Switch Statement: It can more clearly represent multi-branch behavior involving a variable being compared to constant values.

2) Cases: In a switch statement the program executes only one case whose constant expression matches the value of the switch expression, jumps the others, and finishes.

3) Default Case: If no case matches, the last case (default case) statement executes. 4) Break: Omitting this statement will cause the statements within the next case to be

executed. Such as “falling through” to the next case can be useful when multiple cases, such as cases 0, 1, and 2, should execute the same statements.

By Daniel L’Episcopo Page 7

Page 8: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

Section 3.6 – Boolean Data Types

1) Boolean: refers to a quantity that has only two possible values, true or false. Java has the built-in data type Boolean for representing Boolean quantities.

Section 3.7 – String Comparisons

1) Equals: This method returns true if the two strings are equal.2) compareTo(): Compares strings relationally using the notation str1.compareTo(str2)

Section 3.8 – String Access Operations

1) Index: A string is a sequence of character in memory. Each string character has a position number to it starting at 0 not 1.

2) charAt(): The notation someString.charAt(0) determines the character at a particular index of a string, in this case index 0.

3) Exception: A detected runtime error that commonly prints an error message and terminates the program.

Section 3.9 – String Modify Operations

1) Immutable: A programmer cannot directly modify a String’s characters. Instead, a programmer must assign a new value to a String variable if a different value is needed.

Section 3.10 – Character Operations

No Definitions

Section 3.11 – Conditional Expressions

1) Conditional Expression: This is when all three operands are expressions2) Ternary Operator: The “?” and “:” together in a conditional expression

Section 3.12 – Floating-Point Comparison

1) Epsilon: The difference threshold indicating that floating-point numbers are equal.

Section 3.13 – Tweet Decoderpractice

Section 3.14 – Java Example: Salary Calculation with Branches

By Daniel L’Episcopo Page 8

Page 9: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

practice

Section 4.1 – Loops

1) Loops: a construct that repeatedly executes specific code as long as some condition is true.

Section 4.2 – While Loops

1) While Loop: a program construct that executes a list of sub-statements repeatedly as long as the loop’s expression evaluates to true.

2) Loop Body: If true, execution proceeds into sub-statements inside the braces.3) Iteration: Each execution of the loop body. Looping is also called iterating.4) Infinite Loop: A loop that will always execute (i.e., execute infinitely) because the loop’s

expression always evaluates to true. Section 4.3 – More While Examples

Practice

Section 4.4 – Counting

1) Loop Variable: A variable that counts the number of iterations of loop.2) Increment Operator: i = i + 1 is so common in programs, the programming language

provides a shorthand version ++i. 3) Decrement operator: --i is equivalent to i = i – 1.

Section 4.5 – For Loops

1) For Loop: This statement collects three parts – the loop variable initialization, loop expression, and loop variable update – all at the top of the loop.

Section 4.6 – Nested Loops

1) Nested Loop: A loop that appears in the body of another loop.2) Inner Loop: The loop inside an outer loop.3) Outer Loop: The loop that is outside of the inner loop.

Section 4.7 – Developing Programs Incrementally

By Daniel L’Episcopo Page 9

Page 10: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

1) Incrementally: Creating a simple program version, and then growing the program little-by-little into successively more-complete versions.

2) FIXME comment: A commonly used comment to indicate program parts need to be fixed or added.

Section 4.8 – Break and Continue

1) Break Statement: A break statement in a loop causes an immediate exit of the loop.2) Continue Statement: A loop causes an immediate jump to the loop condition check.

Section 4.9 – Enumerations

1) Enumeration Type: Declares a name for a new type and possible values for that type.2) State Machine: A program moves among particular situations or “states”, depending on

input.

Section 4.10 – Additional Practice: Dice Statistics

Practice

Section 4.11 – Java Example: Salary Calculation with Loops

Practice

Section 6.1 – User-Defined Method Basics

1) Method: A named list of statements.2) Method Call: This causes the method’s statements to execute.3) Method Definition: Consists of the new method’s name and a block of statements 4) Block: A list pf statements surrounded by braces.5) Access Modifiers: (i.e. public static) Public tells the compiler that the method may be

called from any class in the program, and static that the method only uses values that are passed to the method.

6) Return: Causes execution to jump back to the original calling location.

Section 6.2 – Parameters1) Parameter: Influence a method’s behavior via an input to the method.2) Argument: A value passed to a parameter.

Section 6.3 – Return

1) Return Statement: How a method may return a value

By Daniel L’Episcopo Page 10

Page 11: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

2) Void: This return type indicated that a method does not return any value, in which case the return statement would simply be: return;

3) Hierarchical Method Calls/ Nested Method Calls: Method calls.

Section 6.4 – Reasons for Defining Methods

1) Module: Another word or method2) Method Stubs: Method definitions whose statements haven’t been written yet. 3) Modular Development: To divide a program into separate modules that can be

developed and tested separately and then integrated into a single program.

Section 6.5 – Methods with Branches/Loops

No Definitions

Section 6.6 – Unit Testing (Methods)

1) Unit Testing: The process of individually testing a small part or unit of a program, typically a method.

2) Testbench/ Test Harness: A separate program whose sole purpose is to check that a method returns correct output values for a variety of input values.

3) Test Vector: Each unique set of input values.4) Border Cases: They represent fringe scenarios.

Section 6.7 – How Method Work

1) Stack Frame: Each method creates a stack of local variables, forming part of a stack frame.

Section 6.8 – Methods: Common Errors

No Definitions

Section 6.9 – Array Parameters

No DefinitionsSection 6.10 – Scope of Variable/Method Definitions

1) Scope: The name of a defined variable or method item is only visible to part of the program.

2) Field/Class Member Variable: A variable declared within a class but outside any method in the program.

By Daniel L’Episcopo Page 11

Page 12: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

3) Global Variables: Variables that can be used throughout the program from opening class brace to closing class brace. They can even be used in methods as well.

4) Side Effects: If a method updates a field, the method has effects that go beyond its parameters and return a value.

Section 6.11 – Method Name Overloading

1) Method Name Overloading / Method Overloading: A program that has two methods with the same name but differ in the number or types of parameters.

Section 6.12 – Java Documentation for Methods

1) Documentation: A written description of a program and its various parts, intended to be read by programmers who must maintain or interface with the program.

2) Javadoc / API: A tool that parses specially formatted muti-line comments to generate a program documentation in HTML format.

3) Doc Comments: Begin with /** and end with */. The beginning two asterisks distinguish doc comments from regular comments.

4) Block Tags: Each are in the form @keyword plus text, each block tag is on its own line.

Section 6.13 – Java Example: Salary Calculation with Methods

Practice

Section 5.1 – Array Concept

1) Array: A special variable having one name, but storing a list of data items, with each item directly accessible in a ordered list.

2) Vector: Another name for a similar construct to an array in other programming languages.

3) Element: Each item in an array.4) Index: This is a specific element location in an array.

Section 5.2 – Arrays

1) Brackets: The [] symbols indicate that the variable is an array reference.2) Array Reference: Refers to an array of various sizes.3) new Operator: Explicitly allocating this array to this form (identifier = new type

[numElements];)

Section 5.3 – Array Iteration Drill

No Definitions

By Daniel L’Episcopo Page 12

Page 13: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

Section 5.4 – Iterating Through Arrays

No Definitions

Section 5.5 – Multiple Arrays

No Definitions

Section 5.6 – Swapping Two Variables

1) Swapping: Taking to variables x and y means to assign y’s value to x, and x’s value to y.

Section 5.7 – Loop-Modifying or Copying/Comparing Arrays

No Definitions

Section 5.8 – Debugging Example: Reversing an Array

No Definitions

Section 5.9 – Two-Dimensional Arrays

1) Row-Major Order: The compiler maps two-dimensional array elements to one-dimensional memory, each following the previous row.

Section 5.10 – Java Example: Salary Calculation with Arrays

Practice

Section 7.1 – Objects: Introduction

1) Object: Consists of some internal data items plus operations that can be performed on that data.

Section 7.2 – Classes: Introduction

1) Class: Defines a new type that can group data and methods to form an object.2) Member Method: A method that is part of (a “member of”) a class.3) Public: The public access modifier is usually before the member methods. 4) Member Access Operator: A member-method call that uses the “.” Operator5) Interface: The class user needs only to use a class’ public member methods.

By Daniel L’Episcopo Page 13

Page 14: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

6) Reference Variable/Reference Type: Declaring a variable of class type.7) Object: Explicitly allocate an instance of a class type. 8) New Operator: Used to explicitly allocate an object.9) Fields: Also referred to as a class’ member variables.10) Class Members: What class’ fields and methods are collectedly called.11) Private: Making clear that a class user cannot directly access the fields.12) Implementation: A programmer defining the details of each member method.

Section 7.3 – Mutators, Accessors, and Private Helpers

1) Mutator: This is a method that may modify (“mutate”) the class’ fields.2) Accessor: This method accesses fields but may not modify them.3) Setter: A method that sets a mutator value4) Getter: A method that sets an accessor for getting its value.5) Private Helper Methods: A way for a programmer to create private methods to help

public methods carry out their tasks.

Section 7.4 – Constructors

1) Constructor: This special class member method is automatically called when a variable of that class type is allocated, and which can be used to initialize all fields.

2) Default Constructor: A constructor that can be called without any arguments.

Section 7.5 – Constructor Overloading

1) Overload: Overloading a constructor means defining multiple constructors differing in parameter types.

Section 7.6 – Unit Testing (Classes)

1) Testbench: A special program to test a class before allowing it to be used in a program.2) Unit Testing: The process of creating and running a program that tests a specific item

(or “unit”), such as a method or a class.3) Assert Statements: Statements that tell to user whether the program has failed or not. 4) Code Coverage: All code is executed at least once (every public method, every private

helper method, and every line of code in a method is executed once).5) Boarder Cases: Integers that include 0, large numbers, negative numbers, etc.6) Regression Testing: Running an existing testbench whenever code is changed.

Section 7.7 – Objects and References

1) Reference: A variable type that refers to an object.2) New Operator: Allocates memory for an object.

By Daniel L’Episcopo Page 14

Page 15: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

Section 7.8 – The ‘this’ Implicit Parameter

1) Implicit Parameter: The compiler converting the syntax objectRefrence.method() into a method call with the object’s reference implicitly passed as a parameter.

2) This: Within a member method, the implicitly-passed object reference is accessible using the “this” keyword.

Section 7.9 – Abstract Data Types: Introduction

1) Abstract Data Type (ADT): A data type whose creation and update are constrained to specific well-defined operations.

2) Information Hiding/Encapsulation: This is a key ADT aspect wherein the internal implementation of ADT’s data and operations are hidden from the ADT user.

Section 7.10 – Primitive and Reference Types

1) Primitive Type: A variable directly stores the data for that variable type, such as int, double or char.

2) Reference Type: This variable can refer to an instance of a class, also known as an object.

3) Primitive Wrapper Classes: Built-in reference types that augment the primitive types. They also allow the program to create objects that store a single primitive type value, such as an integer or floating-point value.

4) Integer: This data type is a built-in class in Java that augments the int primitive type.5) Immutable: A programmer cannot change the object via methods or variable

assignments after object creation.

Section 7.11 – ArrayList

1) ArrayList: An ordered list of reference type items, that comes with Java.2) Element: Each item in an ArrayList.3) Collections: ArrayList is one of several collections supported by Java for keeping groups

of items. A programmer selects the collection whose features best suit the desired task.

Section 7.12 – Classes, ArrayLists, and Methods: A Seat Reservation Example

No Definitions

Section 7.13 – Classes with Classes

No Definitions

Section 7.14 – ArrayList ADT

By Daniel L’Episcopo Page 15

Page 16: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

1) Java Collection Framework (JCF): Defines interfaces and classes for common ADTs known as collections in Java.

2) Collection: Represents a generic group of objects known as elements.3) List: Interface is one of the most commonly used collection types as it represents an

ordered group of elements i.e. a sequence.

Section 7.15 – Java Documentation for Classes

1) Javadoc: The tool parses source code along with specially formatted comments to generate documentation.

2) API (Application Programming Interface): The documentation generated by Javadoc for classes and class members.

3) Doc Comments: Specially formatted comments for Javadoc, which are multi-line comments consisting of all text enclosed between the /** and */ characters.

4) @author: Used to specify an author.5) @version: Used to specify a version number.6) @param: Used to describe a parameter.7) @return: Used to describe the value or object returned by the method.8) @see: Used to refer reader to relevant websites or class members.

Section 7.16 – Parameters of Reference Types

1) Reference Variable: A variable that points to, or refers to, an object or array.2) Immutable: A programmer cannot modify the object’s contents after initialization; new

objects must be created instead.

Section 7.17 – Java Example: Salary Calculation with Classes

Practice

Section 13.1 – Exception Basics

1) Error-Checking Code: Code that a programmer writes to detect and handle error that occur during a program’s execution.

2) Exception: A circumstance that a program was not designed to handle, such as an illogical circumstance.

3) Exception-Handling Constructs: Such as try, throw, and catch constructs that keep error-checking code separate and to reduce redundant checks.

4) Try: This is a block that surrounds normal code, and where throw statements execute.5) Throw: This statement appears within a try block; if reached, execution jumps

immediately to the end of the try block.

By Daniel L’Episcopo Page 16

Page 17: rowdysites.msudenver.edurowdysites.msudenver.edu/.../zyBooksJavaGlossaryDani…  · Web viewThis construct supports printing to the console in Java. System.out.println: Prints out

6) Throwable: This object is provided by the throw statement, much like an object of type Exception or its subclasses. (It’s pretty much like a return statement).

7) Catch: This clause immediately follows a try block; if the catch was reached due to an exception thrown of the catch clause’s parameter type, the clause executes.

8) Handler: This is what a catch block is referred to as, because it handles an exception.

Section 13.2 – Exception with Methods

1) Throw Clause: This is used if a method throws an exception not handled within the method.

2) Checked Exception: An exception that a programmer should be able to anticipate and appropriately handle.

3) Unchecked Exceptions: These expectations are due to hardware or logic errors that typically cannot be anticipated or handled appropriately, and instead should be eliminated from the program or at the very least should cause the program to immediately terminate.

Section 13.3 – Multiple Handlers

1) Catch(Throwable thrwObj): A catch-all handler that catches any error or exception as both are derived from the Throwable class; this handler is useful when listed as the last handler.

Section 13.4 – Exception handling in file input/output

1) FileReader: A class that provides an input stream that allows a programmer to read character from the file specified via FileReader’s constructor.

2) IOException: A built-in checked exception inheriting from the Exception class. 3) FileNotFoundException: Inherits from the IOException, if the specified file cannot be

opened from reading.4) Finally Block: This follows all catch blocks, and executes after the program exits the

corresponding try or catch blocks.5) FileWriter: An object, which provides overloaded write() methods to write a stream of

characters and a close() method to flush the underlying buffer and close the stream.

Section 13.5 – Java Example: Generate Number Format Exception

Practice

By Daniel L’Episcopo Page 17