Is there an equivalent of Python exceptions in Java?

Viewed 352

I'm new on Java, and I would like to know if Java has something like Python exception handling, where you don't have to specify the exception type. Something like:

try:
    f = open('text.tx', 'r')
except:
    #Note you don't have to specify the exception
    print "There's an error here"

I hope you can help me.

3 Answers
Related