Java defines several types of exceptions that relate to its various class libraries. Java also allows users to define their own exceptions.