Ch 1-4 Data Structures and Algorithms in Java 6th edition

studied byStudied by 2 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 124

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

125 Terms

1

method

a function that holds executable statements

New cards
2

identifier

the name of a class, method, or variable

New cards
3

base types (give another name for it as well)

primitive type: commonly used data types such that Java provides them (boolean, char, byte, short, int, long, float, double)

New cards
4

object

the primary actors in java: an instance of a class

New cards
5

class

the type of the object (and a blueprint of the object) that defines what data the object stores and the methods for accessing and modifying that data

New cards
6

2 critical members of a class

instance variables and methods

New cards
7

instance variables (provide its other name)

fields: represent the data associated with an object

New cards
8

accessor method

a method that returns information to the caller without changing any instance variables

New cards
9

update method

a method that may change one or more instance variables when called

New cards
10

default constructor

a zero-parameter constructor

New cards
11

what are the default values for reference variables, boolean variables, and numeric types?

null, false, and 0

New cards
12

"new" operator

returns a reference (memory address) to the newly created instance

New cards
13

a method's signature

a method's name combined with the number and types of its parameters

New cards
14

access control modifiers

modifiers that control the level of access the defining class grants to other classes

New cards
15

"public" modifier

all classes may access the defined aspects

New cards
16

"protected" modifier

access is granted to subclasses and classes belonging to the same package

New cards
17

"private" modifier

access is granted only to the class that defined that member

New cards
18

"static" modifier

variable/method is associated with the class as a whole, rather than with an individual instance

New cards
19

"abstract" modifier

its signature is provided but without implementation of the method body

New cards
20

"final" modifier

can be initialized in the declaration but can never be assigned a new value

New cards
21

the "body" of a method

defines what the method does

New cards
22

compound object

instance variables include all the desired return values, then we merely return a reference to that compound object (as opposed to returning multiple different variables)

New cards
23

"this" keyword

a reference to the instance upon which the method was invoked

New cards
24

"char" - what type and what is it

base type: stores a value that represents a single text character

New cards
25

String

represents a sequence of zero or more characters (immutable)

New cards
26

character index

the way to access a character within a string

New cards
27

concatenation

the primary operation for combining strings

New cards
28

StringBuilder

a mutable version of a string

New cards
29

Array

a sequenced collection of variables of the same type

New cards
30

cell (in an array)

a variable

New cards
31

index (in an array)

refers to the value stored in the cell

New cards
32

element (in an array)

the value stored

New cards
33

capacity (in an array)

the length of the array

New cards
34

Enumerated type (enum)

types that are only allowed to take on values that come from a specified set of names

New cards
35

literal (which ones are allowed)

used to directly express a value in an assignment or other expression: boolean (TF), integer, floating point (1.23F), character ('a'), string ("hello")

New cards
36

pre-increment/post-decrement

++var/--var: 1 is added/subtracted and its new value is the result of the subexpression

New cards
37

post-increment/post-decrement

var++/var--: 1 the incoming value of the variable is the result of the subexpression

New cards
38

generalized operator precedence

method/array indexing/dot operator, post/prefix ops & casting, MDAS, comparison, equality, logical and/or, assignments

New cards
39

casting

an operation that allows us to change the type of a value

New cards
40

explicit casting

(type) expression: either from one primitive type to another primitive type or reference to another reference type

New cards
41

widening/narrowing cast

int to a double vs double to an int

New cards
42

implicit casting

copying values from one variable with one type to another variable to another type, or when perfomring arithmetic operations with a mixture of numeric types

New cards
43

if statement

a way to indicate that the next steps of a program depend on the outcome of some testable conditions

New cards
44

switch

multiple-value control flow (commonly used with enum):

New cards
45

while loop

tests a condition and executes the body each time the condition is evaluated to be true

New cards
46

do-while loop

similar to a while loo but the boolean condition is checked at the END of each pass rather than before

New cards
47

for loop

a while loop under a defined iteration of loop

New cards
48

for-each loop

for (ElementType loop_variable : container)

loopBody

New cards
49

break statement

break out of the innermost switch, for, while, or do-while statement body

New cards
50

continue statement

causes the execution to skip over the remaining steps of the current iteration of the loop but then the flow returns to the top of the loop

New cards
51

package

a set of program/data files used to perform a specific task

New cards
52

robust software

capable of handling unexpected inputs not explicitly defined for its application

New cards
53

adaptable software

evolve over time in response to changing conditions in its environment

New cards
54

portable software

ability of software to run with minimal change on different hardware and operating system platforms

New cards
55

software reusability

the same code can be used as a component of different systems in various applications

New cards
56

abstraction

distill a complicated system down to its fundamental parts

New cards
57

Abstract data types (ADT)

a mathematical model of a data structure that specifies the type of data stored, operations supported on them, and types of parameters of the operations

New cards
58

encapsulation

different components of the software system should not reveal the internal details of their respective implementations

New cards
59

modularity

organizational principle in which different components of a software system are divided into separate functional units

New cards
60

design pattern

a solution to a "typical" software design problem

New cards
61

inheritance

allows a new class to be defined based upon an existing class as the starting point

New cards
62

in OOP, what is the existing class (or root) called? 3 names

base class, parent class, superclass

New cards
63

in OOP, what are inherited classes called? 3 names

derived class, child class, subclass class,

New cards
64

what 2 main ways does a subclass differentiate itself from a superclass?

augment (by adding new fields/methods) and/or specialize (override an existing method)

New cards
65

single inheritance

each class can extend exactly one other class

New cards
66

polymorphism

"many forms" - the ability of a reference variable to take different forms

New cards
67

Liskov Substitution Principle

a variable/parameter with a declared type can be assigned an instance from any direct/indirect subclass of that type

New cards
68

dynamic dispatch

deciding at runtime to call the version of the method that is most specific to the actual type of the referenced object (not the declared type)

New cards
69

arithmetic/geometric progression

adding a fixed constant or multiplying by a fixed constant (that fixed constant is a base)

New cards
70

Fibonacci progression

each value of the series is the sum of the two most recent values

New cards
71

strong typing

the types of parameters that are actually passed to methods rigidly conform with the type specified in the interface

New cards
72

interface

the main structural element that enforces an API - a collection of method declarations with no data and no bodies

New cards
73

multiple inheritance

the ability of extending from more than one type (allowed for interfaces but NOT classes)

New cards
74

mixin

a multiple inheritance technique to approximate the multiple inheritance of concrete classes (that other languages have)

New cards
75

abstract class

between a traditional class and an interface: may define abstract methods (signature but no implementation) AND may also define fields and concrete methods

New cards
76

template method pattern

an abstract base class provides a concrete behavior that relies upon calls to other abstract behaviors

New cards
77

catching an exception

handles an exception in an appropriate fashion

New cards
78

what might cause an exception?

unavailable resources, unexpected input from user, logical errors from the programmer, etc

New cards
79

errors: what throws them and what are they?

thrown by the Java Virtual Machine and designate the most serious situations that are unlikely to be recoverable

New cards
80

what is an exception (generally)?

designate situations in which a running program might reasonably be able to recover

New cards
81

the subtypes of WHAT are treated as unchecked exceptions?

RuntimeException

New cards
82

widening conversion (include 3 common cases)

a type T is converted to a wider type U:

- T and U are class types and U is a superclass of T

- T and U are interface types and U is a superinterface of T

- T is a class that implement interface U

New cards
83

narrowing conversion (include 3 common cases)

a type T is converted to a narrower type S

- T and S are class types and S is a subclass of T

- T and U are interface types and S is a subinterface of T

- T is an interface implemented by class S

New cards
84

composition design pattern

a solution in which we create a class whose instances store a pair of values as a single object

New cards
85

why create nested classes?

when defining a class that is strongly affiliated with another class

New cards
86

outer class

the containing class that has a nested class inside of it

New cards
87

formal name of a nested class

OuterName.NestedName

New cards
88

inner class

a non-static nested class

New cards
89

sorting

starts with an unordered array of elements and rearranging them into nondecreasing order

New cards
90

insertion-sort

an algorithm that considers one element at a time and placing the element in the correct order relative to those before it

New cards
91

"stable" sorting algorithm

guarantees that the relative order of two equivalent elements remains the same in the result as in the original sequence

New cards
92

pseudorandom number generator

objects that compute a sequence of numbers that are statistically random: the next number depends on the previous number(s)

New cards
93

seed

a place to start for a pseudorandom number generator

New cards
94

cryptography

the science of secret messages

New cards
95

encryption (in cryptography)

a message (plaintext) is converted into a scrambled message (ciphertext)

New cards
96

decryption (in cryptography)

turning ciphertext back into its original plaintext

New cards
97

plaintext

a message to be received

New cards
98

ciphertext

scrambled message

New cards
99

Caeser cipher

replacing each letter in a message with the letter that is a certain number of letters later in the alphabet

New cards
100

modulo operator

denoted by % in Java: the remainder of the division of two integers

New cards

Explore top notes

note Note
studied byStudied by 18 people
904 days ago
5.0(1)
note Note
studied byStudied by 66 people
932 days ago
5.0(1)
note Note
studied byStudied by 7 people
913 days ago
5.0(1)
note Note
studied byStudied by 50 people
959 days ago
5.0(2)
note Note
studied byStudied by 20 people
904 days ago
5.0(1)
note Note
studied byStudied by 20 people
1012 days ago
4.5(2)
note Note
studied byStudied by 52 people
48 days ago
5.0(3)
note Note
studied byStudied by 84 people
758 days ago
5.0(3)

Explore top flashcards

flashcards Flashcard (126)
studied byStudied by 9 people
703 days ago
5.0(1)
flashcards Flashcard (58)
studied byStudied by 9 people
661 days ago
4.0(1)
flashcards Flashcard (60)
studied byStudied by 713 people
344 days ago
4.0(4)
flashcards Flashcard (37)
studied byStudied by 3 people
337 days ago
5.0(1)
flashcards Flashcard (140)
studied byStudied by 1 person
87 days ago
5.0(1)
flashcards Flashcard (28)
studied byStudied by 4 people
37 days ago
5.0(1)
flashcards Flashcard (23)
studied byStudied by 4 people
780 days ago
5.0(1)
flashcards Flashcard (275)
studied byStudied by 120 people
3 days ago
5.0(3)
robot