Skip to content

Commit 1bbfadb

Browse files
committed
first commit
0 parents  commit 1bbfadb

File tree

10 files changed

+189
-0
lines changed

10 files changed

+189
-0
lines changed

.classpath

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
26+
<attributes>
27+
<attribute name="maven.pomderived" value="true"/>
28+
</attributes>
29+
</classpathentry>
30+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
31+
<attributes>
32+
<attribute name="maven.pomderived" value="true"/>
33+
</attributes>
34+
</classpathentry>
35+
<classpathentry kind="output" path="target/classes"/>
36+
</classpath>

.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>JavaCollections</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>

.settings/org.eclipse.jdt.core.prefs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.8
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
12+
org.eclipse.jdt.core.compiler.source=1.8

.settings/org.eclipse.m2e.core.prefs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>com.itqpleyva</groupId>
4+
<artifactId>JavaCollections</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<name>JavaCollections</name>
7+
</project>
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
package Collections;
2+
3+
import java.util.ArrayList;
4+
import java.util.Collections;
5+
6+
public class CollectionsMain {
7+
8+
public static void main(String[] args) {
9+
10+
//working with ArrayList
11+
12+
//creating arraylist
13+
ArrayList<String> array = new ArrayList<String>();
14+
array.add("Pepe");
15+
array.add("Pepe1");
16+
array.add("Pepe2");
17+
array.add("Pepe3");
18+
array.add("Pepe4");
19+
array.add("Pepe5");
20+
21+
System.out.println("printing arraylist");//printing arraylist
22+
System.out.println(array);
23+
24+
System.out.println("------------------------------------------------------------");
25+
26+
System.out.println("printing arraylist one by one using method reference");//printing arraylist one by one using method reference
27+
array.forEach(System.out::println);
28+
29+
System.out.println("------------------------------------------------------------");
30+
31+
System.out.println("deleting first element by index");//deleting by index
32+
array.remove(0);
33+
34+
System.out.println("------------------------------------------------------------");
35+
36+
System.out.println("printing after deleting");//printing after deleting
37+
array.forEach(System.out::println);
38+
39+
System.out.println("------------------------------------------------------------");
40+
41+
System.out.println("adding new element in first position by index");//adding new element
42+
array.add(0, "New Pepe");
43+
System.out.println("------------------------------------------------------------");
44+
System.out.println("printing after adding new element");//printing after adding new element
45+
array.forEach(System.out::println);
46+
47+
48+
System.out.println("------------------------------------------------------------");
49+
array.set(0, "Pepe Changed");
50+
System.out.println("printing after set element in the first position");//printing after deleting
51+
array.forEach(System.out::println);
52+
53+
System.out.println("------------------------------------------------------------");
54+
array.remove("Pepe Changed");
55+
System.out.println("printing after deleting Pepe Changed");//printing after deleting
56+
array.forEach(System.out::println);
57+
58+
System.out.println("------------------------------------------------------------");
59+
System.out.println("printing array size");
60+
System.out.println(array.size());
61+
62+
63+
System.out.println("------------------------------------------------------------");
64+
System.out.println("sorting arraylist");
65+
Collections.sort(array);
66+
array.forEach(System.out::println);
67+
68+
System.out.println("------------------------------------------------------------");
69+
System.out.println("printing element index");
70+
System.out.println(array.indexOf("Pepe2"));
71+
72+
System.out.println("------------------------------------------------------------");
73+
System.out.println("getting element by position");
74+
System.out.println(array.get(1));
75+
76+
System.out.println("------------------------------------------------------------");
77+
System.out.println("if array contain element Pepe1");
78+
System.out.println(array.contains("Pepe1"));
79+
80+
System.out.println("------------------------------------------------------------");
81+
System.out.println("deleting all elements in arraylist");
82+
array.clear();
83+
array.forEach(System.out::println);
84+
85+
}
86+
87+
88+
}
3.02 KB
Binary file not shown.

target/classes/META-INF/MANIFEST.MF

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Manifest-Version: 1.0
2+
Built-By: itqpleyva
3+
Build-Jdk: 1.8.0_171
4+
Created-By: Maven Integration for Eclipse
5+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#Generated by Maven Integration for Eclipse
2+
#Mon Mar 16 06:05:52 GMT-04:00 2020
3+
version=0.0.1-SNAPSHOT
4+
groupId=com.itqpleyva
5+
m2e.projectName=JavaCollections
6+
m2e.projectLocation=C\:\\Users\\itqpleyva\\Documents\\java-workspace\\JavaCollections
7+
artifactId=JavaCollections
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>com.itqpleyva</groupId>
4+
<artifactId>JavaCollections</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<name>JavaCollections</name>
7+
</project>

0 commit comments

Comments
 (0)