I found this question in one of the mock exams on assertions is says that the methodA int the class Asserttest throws Assertion error which of the following method can be legally placed in the subclass of the Asserttest
code:
public class Asserttest{
public void methodA(int i) throws AssertionError
{
assert i<1024:"Invalid value";
}
}
The options are:
1. public void methodA(int i)
2. public void methodA(int i) throws Exception
3. public void methodA(int i) throws Throwable
4. public void methodA(int i) throws Error
5. only A is the valid option
i answered as 1,5 but the answer is 1,4 how is option 4 right please explain...