zuai-logo

Glossary

I

Integer Wrapper Class

Criticality: 3

A specific wrapper class in Java that encapsulates a primitive `int` value into an `Integer` object.

Example:

To add an int value to an ArrayList<Integer>, you'd use the Integer Wrapper Class like myList.add(new Integer(42));.

N

Null Values

Criticality: 2

A special state that wrapper class objects can hold, indicating the absence of a value, which is not possible for primitive types.

Example:

An Integer object can be assigned null (e.g., Integer myNum = null;), which is impossible for an int primitive, showcasing the ability to hold null values.

O

Object Requirement

Criticality: 2

The necessity for certain Java methods or data structures, like `ArrayLists`, to accept only objects as parameters or elements, not primitive data types.

Example:

An ArrayList can store Integer objects but not raw int primitives directly, illustrating the object requirement for collections.

P

Primitive data types

Criticality: 3

Fundamental data types in Java that store simple values directly, such as `int`, `double`, `boolean`, and `char`.

Example:

When you declare int score = 100;, int is a primitive data type storing the value directly in memory.

W

Wrapper classes

Criticality: 3

Classes in Java that encapsulate primitive data types into objects, allowing primitives to be treated as objects.

Example:

Instead of int count = 5;, you can use Integer countObject = new Integer(5); where Integer is a wrapper class.