类ExampleA继承Exception,类ExampleB继承ExampleA。

答案解析

ExampleB是ExampleA的子异常,可以被catch(Exception)、catch(ExampleA)或catch(ExampleB)捕获,优先捕获最具体的异常。