# Generics

*noun*

say it: **“juh-NAIR-iks”** **/dʒəˈnɛrɪks/**

Writing a class or method once with a type placeholder, like T, so it works safely with any type.

## What is **Generics** in C#?

**Generics** — Type parameters that let classes and methods work safely with different types.

```csharp
class ListReader
{
    T First<T>(List<T> items)
    {
        return items[0];
    }
}
```

## In a sentence

- “Thanks to **generics**, List&lt;Book> holds only books, and the compiler checks it.”

Level: Freelancer · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=4)

Updated: November 9, 2026

## In other subjects

- [Generics in Java](https://www.ask-codey.com/glossary/generics)
- [Generics in Software Development](https://www.ask-codey.com/glossary/generics-software-development)

Source: https://www.ask-codey.com/glossary/generics-c-sharp
