Skip to content

Glossary: Java Beyond the Basics

ClassCastException

Also written: cast

A run-time error when a value is cast to the wrong type, for example (String) on something that isn't a String. Generics catch this mistake at compile time instead.

Where the book teaches it

Related terms

Generic class