Home
Explore
Exams
Search for anything
Login
Get started
Home
Java Midterm
Java Midterm
0.0
(0)
Rate it
Studied by 0 people
Learn
Practice Test
Spaced Repetition
Match
Flashcards
Card Sorting
1/222
There's no tags or description
Looks like no tags are added yet.
Study Analytics
All
Learn
Practice Test
Matching
Spaced Repetition
Name
Mastery
Learn
Test
Matching
Spaced
No study sessions yet.
223 Terms
View all (223)
Star these 223
1
New cards
Class
A blueprint for creating objects, providing initial state (data) and behavior (methods) for those objects.
2
New cards
Object
An instance of a class that has state and behavior defined by its class.
3
New cards
Encapsulation
The practice of restricting access to certain details of an object, exposing only what is necessary for an external interface.
4
New cards
Instance Data
Variables declared at the class level, unique to each object instance.
5
New cards
Constructor
A special method used for initializing new objects of a class, having the same name as the class.
6
New cards
Accessor Method
A method that returns the value of an instance variable.
7
New cards
Mutator Method
A method that changes the value of an instance variable.
8
New cards
Visibility Modifiers
Keywords in Java that control the accessibility of classes, methods, and variables (e.g., public, private, protected).
9
New cards
UML Class Diagram
A graphical representation of a class, its attributes, operations, and relationships with other classes.
10
New cards
ToString Method
A method that returns a string representation of an object, useful for debugging and logging.
11
New cards
Black Box
An encapsulated object that hides its internal workings, exposing only methods for interaction.
12
New cards
Local Data
Variables declared within a method, accessible only within that method.
13
New cards
Public Method
A method that can be called from outside the class, typically exposing the object's services.
14
New cards
Private Variable
A variable that can only be accessed within its own class, enforcing encapsulation.
15
New cards
MAX (in context of Die class)
A constant representing the maximum face value of a die, typically set to 6.
16
New cards
Support Method
A method that assists a service method but is not intended to be called by clients.
17
New cards
Expression
A combination of one or more operators and operands.
18
New cards
Arithmetic Operators
Operators used to perform arithmetic calculations: addition (+), subtraction (-), multiplication (*), division (/), and remainder (%)
19
New cards
Operator Precedence
A set of rules that determines the order in which operators are evaluated in expressions.
20
New cards
Remainder Operator (%)
Returns the remainder after dividing the first operand by the second.
21
New cards
Increment Operator (++)
An operator that increases the value of a variable by one.
22
New cards
Decrement Operator (--)
An operator that decreases the value of a variable by one.
23
New cards
Assignment Operator (=)
An operator that assigns the value of the right-hand side expression to the variable on the left-hand side.
24
New cards
Casting
The process of converting one data type into another by explicitly specifying the type.
25
New cards
Data Conversion
The process of converting data from one type to another, like treating an integer as a floating-point value.
26
New cards
Widening Conversion
A safe conversion from a smaller data type to a larger data type.
27
New cards
Narrowing Conversion
A conversion from a larger data type to a smaller data type, which can lead to loss of information.
28
New cards
Scanner Class
A class in Java that is used to read input values of various types from different sources.
29
New cards
nextLine() Method
A method of the Scanner class that reads an entire line of text until the end of the line.
30
New cards
Tokens
Elements separated by white space in the input, such as spaces, tabs, and new line characters.
31
New cards
Promotion
Automatic conversion of one data type to another during operations, usually from a smaller to a larger type.
32
New cards
Assignment Conversion
Occurs when a value of one type is assigned to a variable of a different type, allowing only widening conversions.
33
New cards
Character String
A sequence of characters treated as a single data type in programming.
34
New cards
String Literal
A fixed value represented by characters enclosed in double quotes.
35
New cards
println Method
A method used to print a string followed by a new line in Java.
36
New cards
print Method
A method used to print a string without advancing to a new line in Java.
37
New cards
String Concatenation Operator
The + operator used to combine two strings or a string with another data type.
38
New cards
Variable
A named storage location in memory that holds a value.
39
New cards
Assignment Statement
A statement that changes the value of a variable using the = operator.
40
New cards
Constant
An identifier whose value cannot be changed after its initial assignment.
41
New cards
Primitive Data Type
The basic data types provided by Java: byte, short, int, long, float, double, char, boolean.
42
New cards
Boolean Value
A value that represents either true or false.
43
New cards
Escape Sequences
Special character sequences in strings that represent characters that are not directly printable.
44
New cards
Character Set
An ordered list of characters, with each character assigned a unique number.
45
New cards
ASCII
A character encoding standard that uses a subset of Unicode, representing characters with 7 bits.
46
New cards
Unicode
A character encoding standard that defines characters for most of the world's writing systems using 16 bits.
47
New cards
do Statement
A statement that executes a block of code once and then repeats based on a condition.
48
New cards
do loop
A loop that ensures the body is executed at least once before the condition is checked.
49
New cards
for loop
A loop that consists of initialization, condition evaluation, and increment; executes a block of code multiple times.
50
New cards
syntax of a do statement
do { statement-list; } while (condition); The statement-list is executed once, then repeats until the condition is false.
51
New cards
conditional statement
A programming statement that executes based on a specified boolean condition.
52
New cards
initialization in a for loop
The part of a for loop where variables are initialized before execution.
53
New cards
increment in a for loop
The operation that updates the looping variable after each iteration.
54
New cards
infinite loop
A loop that never terminates because the condition for exiting is never met.
55
New cards
for-each loop
A loop designed to iterate over elements in a collection without explicitly managing the iterator.
56
New cards
while loop vs do loop
A while loop checks the condition before executing the body, while a do loop executes the body once before checking the condition.
57
New cards
Java Loops
Statements in Java that allow executing a block of code multiple times based on a condition.
58
New cards
Repetition Statements
Statements that execute a code block repeatedly; often referred to as loops.
59
New cards
While Loop
A loop that executes as long as the specified condition evaluates to true.
60
New cards
Boolean Expressions
Expressions that evaluate to either true or false, controlling the logic of loops and conditionals.
61
New cards
Sentinel Value
A special input value used to signify the end of data input.
62
New cards
Infinite Loop
A loop that does not terminate because the loop condition remains true indefinitely.
63
New cards
Input Validation
The process of ensuring that user input is correct and falls within acceptable limits.
64
New cards
Nested Loops
A loop inside another loop, where the inner loop executes completely for each iteration of the outer loop.
65
New cards
Running Sum
A cumulative total that updates as new values are inputted into a program.
66
New cards
Palindrome
A word, phrase, or sequence that reads the same backward as forward.
67
New cards
Comparing Data
The process of evaluating and relating information using boolean expressions in programming.
68
New cards
Floating Point Values
Numerical values with decimal points; comparisons using == can lead to inaccuracies.
69
New cards
Tolerance
A threshold value determining if two floating point numbers are considered equal based on their closeness.
70
New cards
Unicode
A standardized character encoding system that assigns numerical values to characters for consistent representation.
71
New cards
Lexicographic Ordering
Ordering based on the character set, not strictly alphabetical, where uppercase letters precede lowercase.
72
New cards
Equals Method
A method used in Java to compare two string objects for equality based on their character content.
73
New cards
Switch Statement
A control statement that chooses one of many options, based on the evaluation of an expression.
74
New cards
Break Statement
A command used in switch statements to terminate a case and prevent fall-through to subsequent cases.
75
New cards
ArrayList Class
A resizable array implementation in Java that allows storage and manipulation of lists of objects.
76
New cards
Generics
A feature in Java allowing the definition of classes, interfaces, and methods with placeholder types.
77
New cards
Conditional Operator
An operator that evaluates a boolean condition and returns one of two expressions based on that condition.
78
New cards
Wrapper Classes
Classes in Java that encapsulate primitive data types to be used as objects in data structures like ArrayList.
79
New cards
Conditional Statement
A statement that allows a choice between different actions based on a condition.
80
New cards
Boolean Expression
An expression that evaluates to either true or false, often using relational or equality operators.
81
New cards
if statement
A control structure that executes a statement if its boolean condition evaluates to true.
82
New cards
if-else Statement
A control structure that executes one statement if the condition is true, and another if it is false.
83
New cards
Logical Operators
Operators that combine boolean expressions: Logical AND (&&), Logical OR (||), and Logical NOT (!).
84
New cards
Block Statement
A group of statements enclosed in braces ({}) that can be used as a single statement in control structures.
85
New cards
Nested if Statement
An if statement that is placed inside another if statement, allowing for multiple levels of conditions.
86
New cards
Relational Operators
Operators used to compare two values, returning a boolean result:
87
New cards
Equality Operator
The operator (==) that checks if two values are equal.
88
New cards
Assignment Operator
The operator (=) that assigns a value to a variable.
89
New cards
Truth Table
A table that shows all possible true/false values for logical expressions.
90
New cards
Scanner
A class in Java used to read input from various sources, including user input.
91
New cards
NumberFormat
A class in Java that allows for formatting numbers, including currency.
92
New cards
MAX Constant
A constant used to represent the maximum boundary value in various conditions.
93
New cards
Random Class
A class in Java used to generate pseudo-random numbers.
94
New cards
Method Declaration
Specifies the code that will be executed when the method is invoked.
95
New cards
Method Header
Begins a method declaration and includes the method name, return type, and parameter list.
96
New cards
Return Type
Indicates the type of value that a method sends back to the calling location.
97
New cards
Void Return Type
Indicates that a method does not return a value.
98
New cards
Local Data
Variables declared inside a method, created each time the method is called and destroyed when finished.
99
New cards
Formal Parameters
Parameters specified in the method declaration that receive actual parameters during invocation.
100
New cards
Driver Program
A program that drives the use of other parts of a program, often used for testing.
Load more