zuai-logo

Glossary

A

ArrayLists

Criticality: 3

A resizable array implementation of the List interface that allows for efficient random access to elements.

Example:

When you need to quickly look up or change any item in a list, like accessing the 5th student in a class roster, an ArrayList is ideal.

Autoboxing

Criticality: 2

The automatic conversion that the Java compiler makes between primitive types and their corresponding wrapper classes.

Example:

When you add an int value directly to an ArrayList<Integer>, Java performs autoboxing to convert the int into an Integer object.

D

Deques

Criticality: 1

A double-ended queue, similar to a list, but elements can only be added or removed from either the beginning or the end.

Example:

Imagine a line at a popular food truck where people can join at the back or leave from the front; this behavior is like a Deque.

G

Generics

Criticality: 3

A feature in Java that allows classes, interfaces, and methods to operate on objects of various types while providing compile-time type safety.

Example:

Using ArrayList<String> ensures that your list will only hold String objects, catching type errors during compilation thanks to Generics.

J

Java Collections Framework

Criticality: 3

A set of interfaces and classes in Java that provide a unified architecture for representing and manipulating collections of objects.

Example:

The Java Collections Framework includes tools like ArrayList and HashSet to manage groups of data efficiently.

L

LinkedLists

Criticality: 2

A type of List where elements are linked sequentially, making sequential access efficient but direct access to middle elements slow.

Example:

If you're building a music player that mostly plays songs in order, a LinkedList might be suitable for the playlist.

Lists

Criticality: 3

An ordered collection data type that allows duplicate elements and maintains the insertion order of its elements.

Example:

To keep track of a playlist where songs can repeat and their order matters, you would use a List.

M

Maps

Criticality: 3

A collection data type that stores pairs of items, where each pair consists of a unique key and an associated value.

Example:

Storing student names (keys) and their corresponding grades (values) is a classic use case for a Map.

S

Sets

Criticality: 2

A collection data type where each item is unique (no duplicates) and the order of elements is not guaranteed.

Example:

If you want to store a list of unique student IDs, a Set would be perfect because it automatically prevents duplicates.

U

Unboxing

Criticality: 2

The automatic conversion that the Java compiler makes from a wrapper class object to its corresponding primitive type.

Example:

If you retrieve an Integer object from an ArrayList and assign it to an int variable, Java performs unboxing to get the primitive value.

W

Wrapper Classes

Criticality: 2

Classes in Java that encapsulate primitive data types (like `int` or `double`) into objects, allowing them to be used in contexts where only objects are permitted.

Example:

Integer is a Wrapper Class for the primitive int, enabling you to store integer values in an ArrayList<Integer>.