File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 11package src .main .java .com .types ;
22
33
4+ import java .util .NoSuchElementException ;
5+
46/**
57 * Interface to provide queue specific functionality to the implementing class
68 * This interface only defines the functionality which the queue implementing classes require.
1012public interface Queue <T > extends DataStructure <T > {
1113
1214 //Method to add element
13- public boolean offer (T t );
15+ public boolean offer (T t ) throws NullPointerException ;
1416
1517 //Method to remove element
1618 public T poll ();
@@ -19,7 +21,7 @@ public interface Queue<T> extends DataStructure<T> {
1921 public T peek ();
2022
2123 //Method to check element on head. This throws exception on runtime if the queue is empty
22- public T element ();
24+ public T element () throws NoSuchElementException ;
2325
2426
2527}
You can’t perform that action at this time.
0 commit comments