Answer:
public class PokemonException extends Exception {
public PokemonException() {
super();
}
}
public class KantoPokemonException extends PokemonException {
public KantoPokemonException() {
super();
}
}
public class JohtoPokemonException extends PokemonException {
public JohtoPokemonException() {
super();
}
}
public class HoennPokemonException extends PokemonException {
public HoennPokemonException() {
super();
}
}
public class SinnohPokemonException extends PokemonException {
public SinnohPokemonException() {
super();
}
}
public class UnovaPokemonException extends PokemonException {
public UnovaPokemonException() {
super();
}
}
public class KalosPokemonException extends PokemonException {
public KalosPokemonException() {
super();
}
}
public class AlolaPokemonException extends PokemonException {
public AlolaPokemonException() {
super();
}
}
public class GalarPokemonException extends PokemonException {
public GalarPokemonException() {
super();
}
}
Explanation:
- A separate Java file needs to be created for each of the following exception.
- Inside the constructor, call the super() method to inherit all the properties of a parent class.