-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollection1.java
More file actions
64 lines (53 loc) · 1.04 KB
/
Copy pathCollection1.java
File metadata and controls
64 lines (53 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package basicprograms;
import java.util.ArrayList;
import java.util.Collection;
public class Collection1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Collection c1=new ArrayList();
c1.add("Garima");
c1.add(76);
c1.add(76.76);
c1.add(false);
c1.add('M');
c1.add("Garima");
c1.add(null);
c1.add(null);
c1.add(null);
c1.add("Abhi");
c1.add(2);
c1.add(134);
c1.add(134.134444);
c1.add(true);
System.out.println(c1);
}
}
/* for(int i=0;i<c1.size();i++)
{
}
System.out.println(c1);
}
}*/
/*Collection c2=new ArrayList();
c2.addAll(c1);
c2.add("Wheat");
c2.add("tea");
c2.add("coffee");
c2.add("Rice");
c2.add("Sugar");
System.out.println(c2);
boolean b=c2.equals(c1);
System.out.println(b);
boolean b1=c2.isEmpty();
System.out.println(b1);
boolean b2=c2.containsAll(c1);
System.out.println(b2);
* c1.clear();
* System.out.println(c1);
c1.remove(76);
System.out.println(c1);
c2.removeAll(c1);
System.out.println(c2);
}
}
*/