messagingexcepteion checked or uncheced code example
Example: Can we use catch statement for checked exceptions
If there is no chance of raising an exception in our code then we can’t
declare catch block for handling checked exceptions. This raises compile time
error if we try to handle checked exceptions when there is no possibility
of causing exception.