reference type

A type whose variables hold a reference, a pointer to an object stored elsewhere, rather than the value itself.

In more detail

A reference can be null, meaning it points at no object. Two references can point at the same object, so a change through one is visible through the other.

Examples

C#: classes, records, strings, arrays and delegates are reference types.
Java: classes, interfaces, records, enums and arrays are reference types; using a null reference throws NullPointerException.

Related terms

Taught in

References

Certification courses