Dependency Inversion Principle

Hover (or tap) to flip

High-level modules should depend on abstractions; low-level details should implement those abstractions.

Learn more

ISP practical outcome

Hover (or tap) to flip

Clients implement only what they need, reducing coupling and accidental dependencies.

Learn more

Interface Segregation Principle

Hover (or tap) to flip

Prefer several small, specific interfaces over one large general-purpose interface.

Learn more

Default methods in interfaces

Hover (or tap) to flip

Default methods allow adding behavior to interfaces while keeping backward compatibility.

Learn more

Interface contract

Hover (or tap) to flip

An interface defines capabilities a class promises to provide.

Learn more

When to choose an abstract class

Hover (or tap) to flip

When you want shared implementation plus a partial contract across related classes.

Learn more

Abstract method definition

Hover (or tap) to flip

A method without a body that must be implemented by concrete subclasses.

Learn more

Interface vs abstract class choice

Hover (or tap) to flip

Use interfaces for contracts/multiple inheritance of type; use abstract classes for shared code and state.

Learn more

Abstract class role

Hover (or tap) to flip

An abstract class can define shared state/behavior and leave some methods to be implemented by subclasses.

Learn more

Wildcard bounds meaning

Hover (or tap) to flip

Use ? extends for reading (producer) and ? super for writing (consumer) where appropriate.

Learn more

Generics purpose

Hover (or tap) to flip

Generics provide compile-time type safety and reduce the need for explicit casts.

Learn more

Avoiding ClassCastException

Hover (or tap) to flip

Defensive checks and polymorphism-based design reduce the need for casting.

Learn more

Safe type casting approach

Hover (or tap) to flip

Validate the runtime type (e.g., using instanceof) before casting a reference.

Learn more

Factory Method benefit

Hover (or tap) to flip

Reduces coupling to concrete classes and supports extension without modifying client code.

Learn more

Factory Method pattern intent

Hover (or tap) to flip

Defines a creation method in a base type and lets subclasses decide which concrete type to instantiate.

Learn more

Core collection interfaces

Hover (or tap) to flip

List, Set, Queue/Deque, and Map are the main abstractions used across the framework.

Learn more

Collections Framework overview

Hover (or tap) to flip

A unified architecture of interfaces and implementations for storing and manipulating groups of objects.

Learn more

ArrayList insert/remove cost

Hover (or tap) to flip

Middle insertions/removals may be O(n) because elements need shifting.

Learn more

ArrayList structure

Hover (or tap) to flip

A resizable-array implementation of List with fast random access.

Learn more

LinkedList random access cost

Hover (or tap) to flip

Index-based access is O(n); prefer it for queues/deques rather than frequent get(i).

Learn more