package Exception;
public class Exceptions {
public class NoSpaceException extends RuntimeException {
public NoSpaceException(){
super("There is not enough room in the set for another element.");
}
}
public class NotValidTypeException extends NullPointerException {
public NotValidTypeException(){
super("You can only add strings to a set.");
}
}
public class NoItemException extends NullPointerException {
public NoItemException(){
super("There is no next element.");
}
}
}
My other classes don't have visibility for this package. I have three other classes that may throw one of these exceptions, and I don't want to copy/paste the code above sans package declaration onto each file. I'd like to reduce redundancy and have it as a separate file.
How can I make them visible?