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

Commit 4973cb4

Browse files
HashSet
1 parent 841325b commit 4973cb4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/Hashing1.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ public static void main(String[] args) {
1717
//to print all the elements of the set
1818
System.out.println(set);
1919

20-
//to check whether set contain the target element or not - this will return the boolean value(true/false)
20+
//contains method to check whether set contain the target element or not - this will return the boolean value(true/false)
2121
System.out.println(set.contains(5));
2222
System.out.println(set.contains(6));
2323

24-
//to remove any element from set
24+
//remove method to remove any element from set
2525
set.remove(4);
2626
System.out.println(set);
27+
28+
//size method to check the size of the set
29+
System.out.println(set.size());
2730
}
2831
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /