Sometimes it is useful to define your own Exceptions. It is required if non of the Exceptions defined in Java platform suites you. Obviously this can be bypassed if you simply use if conditions in you program but this will make you code look complicated. For a clean and efficient code, defining own Exception is the ideal way.

mandatory exception handling not required
Java Code:
public class InvalidId extends RuntimeException {
...
}

mandatory exception handling required
Java Code:
public class InvalidId extends Exception{
...
}