Looks like no one added any tags here yet for you.
method
a function that holds executable statements
identifier
the name of a class, method, or variable
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)
object
the primary actors in java: an instance of a class
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
2 critical members of a class
instance variables and methods
instance variables (provide its other name)
fields: represent the data associated with an object
accessor method
a method that returns information to the caller without changing any instance variables
update method
a method that may change one or more instance variables when called
default constructor
a zero-parameter constructor
what are the default values for reference variables, boolean variables, and numeric types?
null, false, and 0
"new" operator
returns a reference (memory address) to the newly created instance
a method's signature
a method's name combined with the number and types of its parameters
access control modifiers
modifiers that control the level of access the defining class grants to other classes
"public" modifier
all classes may access the defined aspects
"protected" modifier
access is granted to subclasses and classes belonging to the same package
"private" modifier
access is granted only to the class that defined that member
"static" modifier
variable/method is associated with the class as a whole, rather than with an individual instance
"abstract" modifier
its signature is provided but without implementation of the method body
"final" modifier
can be initialized in the declaration but can never be assigned a new value
the "body" of a method
defines what the method does
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)
"this" keyword
a reference to the instance upon which the method was invoked
"char" - what type and what is it
base type: stores a value that represents a single text character
String
represents a sequence of zero or more characters (immutable)
character index
the way to access a character within a string
concatenation
the primary operation for combining strings
StringBuilder
a mutable version of a string
Array
a sequenced collection of variables of the same type
cell (in an array)
a variable
index (in an array)
refers to the value stored in the cell
element (in an array)
the value stored
capacity (in an array)
the length of the array
Enumerated type (enum)
types that are only allowed to take on values that come from a specified set of names
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")
pre-increment/post-decrement
++var/--var: 1 is added/subtracted and its new value is the result of the subexpression
post-increment/post-decrement
var++/var--: 1 the incoming value of the variable is the result of the subexpression
generalized operator precedence
method/array indexing/dot operator, post/prefix ops & casting, MDAS, comparison, equality, logical and/or, assignments
casting
an operation that allows us to change the type of a value
explicit casting
(type) expression: either from one primitive type to another primitive type or reference to another reference type
widening/narrowing cast
int to a double vs double to an int
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
if statement
a way to indicate that the next steps of a program depend on the outcome of some testable conditions
switch
multiple-value control flow (commonly used with enum):
while loop
tests a condition and executes the body each time the condition is evaluated to be true
do-while loop
similar to a while loo but the boolean condition is checked at the END of each pass rather than before
for loop
a while loop under a defined iteration of loop
for-each loop
for (ElementType loop_variable : container)
loopBody
break statement
break out of the innermost switch, for, while, or do-while statement body
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
package
a set of program/data files used to perform a specific task
robust software
capable of handling unexpected inputs not explicitly defined for its application
adaptable software
evolve over time in response to changing conditions in its environment
portable software
ability of software to run with minimal change on different hardware and operating system platforms
software reusability
the same code can be used as a component of different systems in various applications
abstraction
distill a complicated system down to its fundamental parts
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
encapsulation
different components of the software system should not reveal the internal details of their respective implementations
modularity
organizational principle in which different components of a software system are divided into separate functional units
design pattern
a solution to a "typical" software design problem
inheritance
allows a new class to be defined based upon an existing class as the starting point
in OOP, what is the existing class (or root) called? 3 names
base class, parent class, superclass
in OOP, what are inherited classes called? 3 names
derived class, child class, subclass class,
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)
single inheritance
each class can extend exactly one other class
polymorphism
"many forms" - the ability of a reference variable to take different forms
Liskov Substitution Principle
a variable/parameter with a declared type can be assigned an instance from any direct/indirect subclass of that type
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)
arithmetic/geometric progression
adding a fixed constant or multiplying by a fixed constant (that fixed constant is a base)
Fibonacci progression
each value of the series is the sum of the two most recent values
strong typing
the types of parameters that are actually passed to methods rigidly conform with the type specified in the interface
interface
the main structural element that enforces an API - a collection of method declarations with no data and no bodies
multiple inheritance
the ability of extending from more than one type (allowed for interfaces but NOT classes)
mixin
a multiple inheritance technique to approximate the multiple inheritance of concrete classes (that other languages have)
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
template method pattern
an abstract base class provides a concrete behavior that relies upon calls to other abstract behaviors
catching an exception
handles an exception in an appropriate fashion
what might cause an exception?
unavailable resources, unexpected input from user, logical errors from the programmer, etc
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
what is an exception (generally)?
designate situations in which a running program might reasonably be able to recover
the subtypes of WHAT are treated as unchecked exceptions?
RuntimeException
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
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
composition design pattern
a solution in which we create a class whose instances store a pair of values as a single object
why create nested classes?
when defining a class that is strongly affiliated with another class
outer class
the containing class that has a nested class inside of it
formal name of a nested class
OuterName.NestedName
inner class
a non-static nested class
sorting
starts with an unordered array of elements and rearranging them into nondecreasing order
insertion-sort
an algorithm that considers one element at a time and placing the element in the correct order relative to those before it
"stable" sorting algorithm
guarantees that the relative order of two equivalent elements remains the same in the result as in the original sequence
pseudorandom number generator
objects that compute a sequence of numbers that are statistically random: the next number depends on the previous number(s)
seed
a place to start for a pseudorandom number generator
cryptography
the science of secret messages
encryption (in cryptography)
a message (plaintext) is converted into a scrambled message (ciphertext)
decryption (in cryptography)
turning ciphertext back into its original plaintext
plaintext
a message to be received
ciphertext
scrambled message
Caeser cipher
replacing each letter in a message with the letter that is a certain number of letters later in the alphabet
modulo operator
denoted by % in Java: the remainder of the division of two integers