I'm having a hard time understanding how exception handling is implemented. I know that, for example:
If an array, stack, queue, any abstract data time is empty, then you can throw an exception which can output a message saying its empty or some sort.
What I'm confused is, what is the exception? Like in this case, do you have to make a function that outputs a message saying its empty? or is it a predefined function which you can just call upon as an exception?