That's because the "class A" has a constuctor which throws an exception, so when some class extends this class, in this case the "class Test9", you have to deal with this exception in the constructor of the class which extends, so that when you call the Test9's constructor, it will call the super's constructor which throws an exception, that must be caught or thrown by the Test9's constructor.
And about the main method, when you throw an exception within a main method, there's nobody else who will be able to catch the exception, so the exception will not be caught.