Skip to content

Glossary: Software Design Patterns in Java

Magic number

Also written: magic numbers

A number in code with no name saying what it means, like `75` and `0.85` in the old `placeOrder`. A named constant fixes it.

Where the book teaches it

Related terms

Anti-pattern