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 1
1
package src .main .java .com .types ;
2
2
3
3
4
+ import java .util .NoSuchElementException ;
5
+
4
6
/**
5
7
* Interface to provide queue specific functionality to the implementing class
6
8
* This interface only defines the functionality which the queue implementing classes require.
10
12
public interface Queue <T > extends DataStructure <T > {
11
13
12
14
//Method to add element
13
- public boolean offer (T t );
15
+ public boolean offer (T t ) throws NullPointerException ;
14
16
15
17
//Method to remove element
16
18
public T poll ();
@@ -19,7 +21,7 @@ public interface Queue<T> extends DataStructure<T> {
19
21
public T peek ();
20
22
21
23
//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 ;
23
25
24
26
25
27
}
You can’t perform that action at this time.
0 commit comments