Question: Consider the deleteFirst ( ) method of the ArrayedList class: public void deleteFirst ( ) { if ( isEmpty ( ) ) throw new RuntimeException
Consider the deleteFirst method of the ArrayedList class:
public void deleteFirst
if isEmpty
throw new RuntimeExceptionError: cannot delete an item from an empty list.";
for int ; this.listTail ;
this. listElements this.listElements ;
this.listTail;
Further suppose that we define a specific exception for this method to throw instead of a generic RuntimeException:
public class ContainerFullException extends RuntimeException
public ContainerFullExceptionString message
supermessage;
public ContainerFullException
superContainerFulException thrown!";
and then modify deleteFirst to throw ContainerFullException instead of RuntimeException.
Which of the following conditions do we have to check for if we are testing the deleteFirst method when the list is empty? check all that apply
Whether the method throws ContainerFullExceptiona successful test
Whether the method throws no exception a failed test
Whether the method throws a different exception a failed test
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
