program 17-18B
This commit is contained in:
BIN
Screenshots/program17A.png
Normal file
BIN
Screenshots/program17A.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
BIN
Screenshots/program17B.png
Normal file
BIN
Screenshots/program17B.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
BIN
Screenshots/program17C.png
Normal file
BIN
Screenshots/program17C.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
BIN
Screenshots/program18A.png
Normal file
BIN
Screenshots/program18A.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
BIN
Screenshots/program18B.png
Normal file
BIN
Screenshots/program18B.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
16
TestJavaCollection10.java
Normal file
16
TestJavaCollection10.java
Normal file
@@ -0,0 +1,16 @@
|
||||
// 17C
|
||||
import java.util.*;
|
||||
public class TestJavaCollection10{
|
||||
public static void main(String args[]){
|
||||
LinkedHashSet<String> set = new LinkedHashSet<>();
|
||||
set.add("Ravi");
|
||||
set.add("Vijay");
|
||||
set.add(null);
|
||||
set.add("Ravi");
|
||||
set.add("Ajay");
|
||||
Iterator<String> itr = set.iterator();
|
||||
while(itr.hasNext()){
|
||||
System.out.println(itr.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
15
TestJavaCollection11.java
Normal file
15
TestJavaCollection11.java
Normal file
@@ -0,0 +1,15 @@
|
||||
// 18 write a java code to demonstrate treeset
|
||||
import java.util.*;
|
||||
public class TestJavaCollection11{
|
||||
public static void main(String args[]){
|
||||
TreeSet<String> set = new TreeSet<>();
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
17
TestJavaCollection12.java
Normal file
17
TestJavaCollection12.java
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
// 18B write a java code to demonstrate treeset
|
||||
import java.util.*;
|
||||
public class TestJavaCollection12{
|
||||
public static void main(String args[]){
|
||||
TreeSet<String> set = new TreeSet<>();
|
||||
set.add("Ravi");
|
||||
set.add("Vijay");
|
||||
set.add(null);
|
||||
set.add("Ravi");
|
||||
set.add("Ajay");
|
||||
Iterator<String> itr = set.iterator();
|
||||
while(itr.hasNext()){
|
||||
System.out.println(itr.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
16
TestJavaCollection8.java
Normal file
16
TestJavaCollection8.java
Normal file
@@ -0,0 +1,16 @@
|
||||
// 17A write a java code to demonstrate linked hash set
|
||||
import java.util.*;
|
||||
public class TestJavaCollection8{
|
||||
public static void main(String args[]){
|
||||
LinkedHashSet<String> set = new LinkedHashSet<>();
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
17
TestJavaCollection9.java
Normal file
17
TestJavaCollection9.java
Normal file
@@ -0,0 +1,17 @@
|
||||
// 17B
|
||||
import java.util.*;
|
||||
public class TestJavaCollection9{
|
||||
public static void main(String args[]){
|
||||
LinkedHashSet<String> set = new LinkedHashSet<>();
|
||||
set.add("Ravi");
|
||||
set.add("Vijay");
|
||||
set.add("");
|
||||
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