program 16
This commit is contained in:
BIN
Screenshots/program16.png
Normal file
BIN
Screenshots/program16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
15
TestJavaCollection7.java
Normal file
15
TestJavaCollection7.java
Normal file
@@ -0,0 +1,15 @@
|
||||
// 16 write a java program to demonstrate HashSet
|
||||
import java.util.*;
|
||||
public class TestJavaCollection7{
|
||||
public static void main(String args[]){
|
||||
HashSet<String> set = new HashSet<String>();
|
||||
set.add("Ravi");
|
||||
set.add("Vijay");
|
||||
set.add("Ravi");
|
||||
set.add("Ajay");
|
||||
Iterator<String> itr = set.iterator();
|
||||
while(itr.hasNext()){
|
||||
System.out.println(itr.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user