Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ce337f

Browse files
author
asri71
committed
Code changes to adhere to code best practices
1 parent320b5de commit5ce337f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/main/java/com/types/Queue.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
packagesrc.main.java.com.types;
22

33

4+
importjava.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.
@@ -10,7 +12,7 @@
1012
publicinterfaceQueue<T>extendsDataStructure<T> {
1113

1214
//Method to add element
13-
publicbooleanoffer(Tt);
15+
publicbooleanoffer(Tt)throwsNullPointerException;
1416

1517
//Method to remove element
1618
publicTpoll();
@@ -19,7 +21,7 @@ public interface Queue<T> extends DataStructure<T> {
1921
publicTpeek();
2022

2123
//Method to check element on head. This throws exception on runtime if the queue is empty
22-
publicTelement();
24+
publicTelement()throwsNoSuchElementException;
2325

2426

2527
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp