1/75
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
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.
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.
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.
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.
Persistent Field
A field within an object that ensures its data is included when the object is serialized.
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.
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.
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.
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.
Class (OOP)
An abstract data type (ADT) that serves as a blueprint for objects, defining their attributes (member variables) and behaviors (functions or methods).
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.
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.
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.
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.
Public (Access Modifier)
An access modifier that allows a member to be accessed from any other class, providing the widest level of visibility.
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.
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.
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.
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.
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).
Getters (Accessors)
Public methods used to retrieve the values of private or protected member variables, providing controlled access to an object's state.
Setters (Mutators)
Public methods used to modify the values of private or protected member variables, providing controlled modification of an object's state.
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.
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).
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.
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().
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.
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.
Shallow Equality
A comparison that checks if two object references point to the exact same object in memory, typically performed using the == operator.
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.
notify() and wait() (Multithreading)
Methods provided by the Object class used for inter-thread communication, allowing threads to coordinate their execution for shared resources.
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.
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.
Heap Default Initialization
Numeric types are initialized to 0, boolean types to false, and reference types to null in [this kind of] memory.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Autoboxing
The automatic conversion by the Java compiler of a primitive type into its corresponding wrapper class object (e.g., int to Integer).
Unboxing
The automatic conversion by the Java compiler of a wrapper class object into its corresponding primitive type (e.g., Integer to int).
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.
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.
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.
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).
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.
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').
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').
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.
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.
Multithreaded GUI
A graphical user interface designed to use multiple threads to ensure responsiveness, allowing background tasks to run without freezing the user interface.
Java AWT
Abstract Window Toolkit, one of Java's earliest GUI APIs, considered outdated but foundational.
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.
JavaFX
The newest and most modern GUI platform for Java, but the professor states it has significant flaws.
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.
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.
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.
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.
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.
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.
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.
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.
Components of a Recursive Algorithm
Recursion Termination: A base case or end condition to halt recursion.
Divide the Problem: Breaking the problem into smaller, manageable subproblems.
Recurrences: The recursive statement applied to each subproblem.
Combine: Merging the results from the recursive calls.
Statically Typed Language (Java)
Java is a strictly [ ], meaning the type of a variable is determined and verified during the compile-time phase.
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.
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.
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.
Multithreading Language Support
Multithreading is not exclusive to Java; many other programming languages also support it.
Sequential Programming
A programming paradigm where instructions are executed in a fixed, linear order, providing predictable control over program flow.
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.
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.