Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
37 lines (36 loc) · 988 Bytes

File metadata and controls

37 lines (36 loc) · 988 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import java.util.ArrayList;
import studsclonedeep.Scrutin;
import studsclonedeep.Personne;
public class TestCloneDeep {
public static void main(final String[] args)
throws CloneNotSupportedException {
Personne p = new Personne("Dupont", "Julien");
p.organiserScrutin("Election bde");
Personne p1 = p.clone();
if (p1 == p) {
System.out.println("p == p1");
}
if (p.getNom() == p1.getNom()) {
System.out.println("p et p1 noms ==");
}
if (p.getPrenom() == p1.getPrenom()) {
System.out.println("p et p1 prenoms ==");
}
ArrayList<Scrutin> a1, a2;
a1 = p.getScrutins();
a2 = p1.getScrutins();
if (a1 == a2) {
System.out.println("p et p1 scrutins ==");
} else {
for(int i = 0; i < a1.size(); i++) {
if(a1.get(i) == a2.get(i)) {
System.out.println("Scrutins de rang " + i +" ==");
} else {
if(a1.get(i).getOrganisateur() == a2.get(i).getOrganisateur()) {
System.out.println("Oraganisateur des scrutins de rang" + i +"==");
}
}
}
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.