Skip to content

Commit c1162e7

Browse files
Java List Find Duplicate Objects
1 parent 03f5b63 commit c1162e7

File tree

8 files changed

+472
-0
lines changed

8 files changed

+472
-0
lines changed

ListFindDuplicateObject/.idea/compiler.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ListFindDuplicateObject/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ListFindDuplicateObject/.idea/misc.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ListFindDuplicateObject/.idea/workspace.xml

Lines changed: 276 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4" />

ListFindDuplicateObject/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>ListFindDuplicateObject</groupId>
8+
<artifactId>ListFindDuplicateObject</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<description>Java List Find Duplicate Objects Example</description>
11+
<build>
12+
<plugins>
13+
<plugin>
14+
<groupId>org.apache.maven.plugins</groupId>
15+
<artifactId>maven-compiler-plugin</artifactId>
16+
<configuration>
17+
<source>8</source>
18+
<target>8</target>
19+
</configuration>
20+
</plugin>
21+
</plugins>
22+
</build>
23+
<properties>
24+
<maven.compiler.source>1.8</maven.compiler.source>
25+
<maven.compiler.target>1.8</maven.compiler.target>
26+
</properties>
27+
28+
</project>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.javadeveloperzone;
2+
3+
import java.util.Objects;
4+
5+
public class Employee {
6+
int empId;
7+
String empName;
8+
String empAddress;
9+
10+
public int getEmpId() {
11+
return empId;
12+
}
13+
14+
public void setEmpId(int empId) {
15+
this.empId = empId;
16+
}
17+
18+
public String getEmpName() {
19+
return empName;
20+
}
21+
22+
public void setEmpName(String empName) {
23+
this.empName = empName;
24+
}
25+
26+
public Employee(int empId, String empName, String empAddress) {
27+
this.empId = empId;
28+
this.empName = empName;
29+
this.empAddress = empAddress;
30+
}
31+
32+
@Override
33+
public boolean equals(Object o) {
34+
if (this == o) return true;
35+
if (o == null || getClass() != o.getClass()) return false;
36+
Employee employee = (Employee) o;
37+
return empId == employee.empId &&
38+
empName.equals(employee.empName) &&
39+
empAddress.equals(employee.empAddress);
40+
}
41+
42+
@Override
43+
public int hashCode() {
44+
return Objects.hash(empId, empName, empAddress);
45+
}
46+
}

0 commit comments

Comments
 (0)