CSC 220 - Final Review

0.0(0)
studied byStudied by 9 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/75

flashcard set

Earn XP

Description and Tags

Review for the final exam - CLU

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

76 Terms

1
New cards

Text File (.txt)

This kind of file is human readable and can be edited with common editors, but they also have metadata that bloats the storage size.

2
New cards

Binary File (.bin)

This type of file contains data in a format that is not human-readable and is often designed for specific software applications, resulting in more efficient storage usage.

3
New cards

Serialization

The concept used to streamline object data into a file or to reconstruct an object from a streamlined file, where not all fields (e.g., transient or static) are included.

4
New cards

Transient Field

A field within an object that is explicitly marked not to be included when the object is serialized, often used for sensitive data like passwords.

5
New cards

Persistent Field

A field within an object that ensures its data is included when the object is serialized.

6
New cards

Object File

A type of binary file that cannot be read with a standard text editor but can be accessed and interpreted using code or specialized tools.

7
New cards

try-catch-finally block

A control flow construct used for exception handling where code that might throw an exception is placed in try, specific exceptions are handled in catch, and cleanup code is executed in finally regardless of an exception occurring.

8
New cards

finally block

A block of code within a try-catch-finally structure that is guaranteed to execute after the try block and any matching catch block, typically used for cleanup operations like closing files.

9
New cards

Generic Exception Handling

Utilizing a generic catch (Exception e) block. If placed first, it will catch all exceptions, preventing subsequent, more specific catch blocks from being reached.

10
New cards

Class (OOP)

An abstract data type (ADT) that serves as a blueprint for objects, defining their attributes (member variables) and behaviors (functions or methods).

11
New cards

Abstract Data Type (ADT)

A mathematical model for data types, where behavior is defined by a set of values and a set of operations, and its implementation details are hidden.

12
New cards

Access Modifiers

Keywords in OOP (Private, Protected, Public, Package) that control the visibility and accessibility of classes, fields, constructors, and methods, influencing design and usage.

13
New cards

Private (Access Modifier)

An access modifier that restricts access to a member (field or method) so that it can only be accessed from within its own class.

14
New cards

Protected (Access Modifier)

An access modifier that allows a member to be accessed from within its own class, by classes that extend it (subclasses), and other classes within the same package.

15
New cards

Public (Access Modifier)

An access modifier that allows a member to be accessed from any other class, providing the widest level of visibility.

16
New cards

Package-Private (Default Access Modifier)

The default access level in Java (no keyword specified), allowing a member to be accessed only by other classes within the same package.

17
New cards

Final Keyword (Variable)

When applied to a variable, it makes the variable a constant; its value must be assigned at construction and cannot be changed thereafter.

18
New cards

Final Keyword (Class)

When applied to a class, it prevents other classes from extending (inheriting from) it, ensuring its implementation cannot be altered by subclasses.

19
New cards

Static Keyword

When applied to a member variable or function, it signifies that the member belongs to the class itself, rather than to any specific instance of the class, allowing access directly via the class name.

20
New cards

Constructor

A special method used to instantiate an object of a class, initializing its fields and allocating memory for the new object on the heap (via the new operator).

21
New cards

Getters (Accessors)

Public methods used to retrieve the values of private or protected member variables, providing controlled access to an object's state.

22
New cards

Setters (Mutators)

Public methods used to modify the values of private or protected member variables, providing controlled modification of an object's state.

23
New cards

Scope (Programming)

The region of a program where a defined variable or function can be accessed, typically defined by curly braces {} in languages like Java.

24
New cards

Composition/Aggregation

A 'has a' relationship between classes, where one class contains instances of other classes as its parts (e.g., Car 'has a' Engine).

25
New cards

Inheritance

An 'is a' relationship where a child class (subclass) extends a parent class (superclass), inheriting its members and optionally adding to or restricting them.

26
New cards

Object Class

The root of the inheritance hierarchy in Java; all other classes implicitly extend this class and inherit its basic methods, such as toString() and equals().

27
New cards

Method Overriding

The ability of a subclass to provide a specific implementation for a method that is already defined in its superclass, allowing for specialized behavior.

28
New cards

Deep Equality

A comparison that checks if the content (values of fields) of two objects are the same, typically implemented by overriding the .equals(Object o) method.

29
New cards

Shallow Equality

A comparison that checks if two object references point to the exact same object in memory, typically performed using the == operator.

30
New cards

hashCode()

A method inherited from the Object class that returns an integer representation of an object, often thought of as a memory location representation, used primarily in hash-based collections.

31
New cards

notify() and wait() (Multithreading)

Methods provided by the Object class used for inter-thread communication, allowing threads to coordinate their execution for shared resources.

32
New cards

Stack Memory

A region of memory used for local variables, method call parameters, and return addresses. Variables defined here are not automatically initialized by Java.

33
New cards

Heap Memory

A region of memory used for objects created with the new operator and arrays. Memory in the heap is managed by the garbage collector and variables are automatically initialized to default values.

34
New cards

Heap Default Initialization

Numeric types are initialized to 0, boolean types to false, and reference types to null in [this kind of] memory.

35
New cards

Garbage Collector

A process in Java that automatically reclaims memory from objects in the heap that are no longer referenced by any part of the program, returning it to the heap pool.

36
New cards

Compiletime

The phase of program execution where the source code is translated into bytecode by the compiler, which checks for syntax and grammar errors and generates .class files.

37
New cards

Runtime

The phase of program execution where the bytecode (.class files) is executed by the Java Virtual Machine (JVM), during which runtime binding occurs and components are verified as needed.

38
New cards

Runtime Binding

A mechanism where the existence of program components (methods, variables) is verified and linked only when they are actually needed during program execution, rather than at compiletime.

39
New cards

Generics

A feature that allows defining classes, interfaces, and methods with a type parameter, enabling code to operate on objects of various types while providing compile-time type safety.

40
New cards

Type Parameter (Generics)

A placeholder for a data type in a generic class or method definition, which is substituted with a concrete type at compile-time.

41
New cards

Wildcard <?> (Generics)

an unknown type, analogous to casting at compile-time, often used to indicate that a method can accept a collection of any type.

42
New cards

Bounded Type Parameter (Generics)

A feature that restricts the types that can be used as arguments for a type parameter in generics (e.g., <T extends Number>), ensuring type safety and allowing specific operations.

43
New cards

Array of Objects

An array that can hold instances of different classes (heterogeneous) or wrapper class versions of primitive types; only the array itself is fully constructed initially, not the objects within it.

44
New cards

Wrapper Classes

Classes in Java (e.g., Integer, Boolean, Double) that enclose primitive data types to allow them to be treated as objects, which is necessary for certain data structures and generic programming.

45
New cards

Autoboxing

The automatic conversion by the Java compiler of a primitive type into its corresponding wrapper class object (e.g., int to Integer).

46
New cards

Unboxing

The automatic conversion by the Java compiler of a wrapper class object into its corresponding primitive type (e.g., Integer to int).

47
New cards

Uninitialized Objects in Array

When an array of objects is created, memory for the array itself is allocated, and references are set, but the actual objects (elements) at those references are not yet instantiated or initialized.

48
New cards

ArrayList

A dynamic array data structure that stores objects at contiguous memory locations. Adding to the end can cause expensive expansion if capacity is exceeded, involving creating a larger array and copying data.

49
New cards

LinkedList

A sequential access data structure where elements are not necessarily contiguous in memory, linked together by references. Insertion is generally faster than ArrayLists, but searching requires iteration.

50
New cards

Singly Linked List

A type of data structure where each node contains data and a reference (pointer) to the next node in the sequence, allowing traversal in one direction (head to tail).

51
New cards

Doubly Linked List

A type of data structure where each node contains data and references (pointers) to both the next node and the previous node, allowing traversal in both directions.

52
New cards

Stack (Data Structure)

A Last-In, First-Out (LIFO) linear data structure implemented like a linked list, where elements are added (push) and removed (pop) from the same end (the 'top').

53
New cards

Queue (Data Structure)

A First-In, First-Out (FIFO) linear data structure, implemented like a linked list, where elements are added to one end (the 'rear') and removed from the other end (the 'front').

54
New cards

HashMap

A data structure that uses a hash function to map keys to values, often implemented as an array of linked lists. It provides fast data retrieval by calculating an index from the key.

55
New cards

Hash Function

A function used in data structures like HashMap that computes an index from a given key, determining the location in an array where the object should be stored. A uniform distribution is desirable.

56
New cards

Multithreaded GUI

A graphical user interface designed to use multiple threads to ensure responsiveness, allowing background tasks to run without freezing the user interface.

57
New cards

Java AWT

Abstract Window Toolkit, one of Java's earliest GUI APIs, considered outdated but foundational.

58
New cards

Java Swing

A GUI toolkit for Java that was a rewrite and improvement over AWT, providing a richer set of components and a pure Java implementation.

59
New cards

JavaFX

The newest and most modern GUI platform for Java, but the professor states it has significant flaws.

60
New cards

Thread States (Multithreading)

Threads can be in various states, including "block" and "ready." The running() state for a thread is controlled by the JVM, which schedules threads based on priority, equity, or policy, not directly by the programmer.

61
New cards

Thread Dependence/Independence

Threads can operate either independently or depend on each other for communication or shared resources. Sharing resources can lead to varied results depending on system architecture if not properly managed.

62
New cards

Deadlock (Multithreading)

A situation where two or more threads are perpetually blocked, each waiting for a resource or data held by another. It can be prevented through proper synchronization.

63
New cards

Synchronization (Multithreading)

A mechanism applied to a function or class that ensures only one thread can execute it at a time. Other threads attempting access are moved into a "block" state, then to a "ready" state before being scheduled to run.

64
New cards

Benefits of Multithreading

Multithreading improves Performance by enabling concurrent execution on multi-core systems (or efficient context switching on single-core systems) and enhances Responsivity by keeping the user interface interactive during background operations.

65
New cards

Recursive Function

A function that solves a problem by calling itself, typically breaking down a larger problem into smaller, similar subproblems. An example is the factorial calculation.

66
New cards

Recursion vs. Iteration

Recursion is not essential; any recursive algorithm can be re-implemented iteratively using loops or by explicitly managing a stack data structure.

67
New cards

Stackframe (Recursion)

When a function is called, a stackframe is pushed onto the call stack, holding local variables and return information. Excessive recursive calls without a proper termination condition can lead to a stack overflow error.

68
New cards

Components of a Recursive Algorithm

  1. Recursion Termination: A base case or end condition to halt recursion.

  2. Divide the Problem: Breaking the problem into smaller, manageable subproblems.

  3. Recurrences: The recursive statement applied to each subproblem.

  4. Combine: Merging the results from the recursive calls.

69
New cards

Statically Typed Language (Java)

Java is a strictly [ ], meaning the type of a variable is determined and verified during the compile-time phase.

70
New cards

Dynamic Type (Runtime)

While Java is statically typed, a variable declared as a supertype (e.g., Object) can hold an instance of a subtype. The actual type of the object (its dynamic type) is determined at runtime.

71
New cards

instanceOf() Operator

A keyword used at runtime to check if an object is an instance of a specific class or interface, enabling safe type checking before casting.

72
New cards

Reflection API (Java)

A Java API that allows a program to inspect and modify its own structure and behavior at runtime. It can access public member variables, functions, and constructors from .Class files, and even dynamically call methods or access variables during execution.

73
New cards

Multithreading Language Support

Multithreading is not exclusive to Java; many other programming languages also support it.

74
New cards

Sequential Programming

A programming paradigm where instructions are executed in a fixed, linear order, providing predictable control over program flow.

75
New cards

Event-Driven Programming

A programming paradigm where program execution is determined by events. Events are placed in a queue and processed, requiring the program to be prepared to handle events at any time.

76
New cards

Event Handlers

Code segments that execute in response to specific events. They must complete quickly without interruption to maintain application responsiveness; otherwise, multithreading may be necessary.