SlideShare a Scribd company logo
1 of 5
Download to read offline
import java.util.ArrayList;
import java.util.List;
/**
*
*
*/
public class AList {
List list = new ArrayList();
public AList() {
// TODO Auto-generated constructor stub
}
/**
*
*/
public AList(List list) {
this.list = list;
}
/*
* (non-Javadoc)
*
* see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object obj) {
// TODO Auto-generated method stub
AList aList = (AList) obj;
List arrayList = aList.getList();
if (arrayList.size() != list.size()) {
return false;
}
for (int i = 0; i < list.size(); i++) {
if (list.get(i) != arrayList.get(i)) {
return false;
}
}
return true;
}
/**
* return the list
*/
public List getList() {
return list;
}
/**
* param list
* the list to set
*/
public void setList(List list) {
this.list = list;
}
/**
* param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
List integers = new ArrayList();
integers.add(10);
integers.add(20);
integers.add(30);
integers.add(40);
integers.add(50);
List integers1 = new ArrayList();
integers1.add(10);
integers1.add(20);
integers1.add(30);
integers1.add(40);
integers1.add(60);
AList aList1 = new AList(integers);
AList aList2 = new AList(integers);
System.out.println("list1 and list2 are equal? "
+ aList1.equals(aList2));
aList2 = new AList(integers1);
System.out
.println("After adding 60 to list2, list1 and list2 are not equal? "
+ aList1.equals(aList2));
}
}
OUTPUT:
list1 and list2 are equal? true
After adding 60 to list2, list1 and list2 are not equal? false
Solution
import java.util.ArrayList;
import java.util.List;
/**
*
*
*/
public class AList {
List list = new ArrayList();
public AList() {
// TODO Auto-generated constructor stub
}
/**
*
*/
public AList(List list) {
this.list = list;
}
/*
* (non-Javadoc)
*
* see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object obj) {
// TODO Auto-generated method stub
AList aList = (AList) obj;
List arrayList = aList.getList();
if (arrayList.size() != list.size()) {
return false;
}
for (int i = 0; i < list.size(); i++) {
if (list.get(i) != arrayList.get(i)) {
return false;
}
}
return true;
}
/**
* return the list
*/
public List getList() {
return list;
}
/**
* param list
* the list to set
*/
public void setList(List list) {
this.list = list;
}
/**
* param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
List integers = new ArrayList();
integers.add(10);
integers.add(20);
integers.add(30);
integers.add(40);
integers.add(50);
List integers1 = new ArrayList();
integers1.add(10);
integers1.add(20);
integers1.add(30);
integers1.add(40);
integers1.add(60);
AList aList1 = new AList(integers);
AList aList2 = new AList(integers);
System.out.println("list1 and list2 are equal? "
+ aList1.equals(aList2));
aList2 = new AList(integers1);
System.out
.println("After adding 60 to list2, list1 and list2 are not equal? "
+ aList1.equals(aList2));
}
}
OUTPUT:
list1 and list2 are equal? true
After adding 60 to list2, list1 and list2 are not equal? false

More Related Content

Similar to import java.util.ArrayList; import java.util.List; .pdf

Lecture 18Dynamic Data Structures and Generics (II).docx
Lecture 18Dynamic Data Structures and Generics (II).docxLecture 18Dynamic Data Structures and Generics (II).docx
Lecture 18Dynamic Data Structures and Generics (II).docxSHIVA101531
 
Please complete all the code as per instructions in Java programming.docx
Please complete all the code as per instructions in Java programming.docxPlease complete all the code as per instructions in Java programming.docx
Please complete all the code as per instructions in Java programming.docxcgraciela1
 
Please do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdfPlease do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdfaioils
 
Please help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdfPlease help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdfseoagam1
 
For this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdfFor this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdffashiongallery1
 
Note- Can someone help me with the public boolean isEmpty()- public bo.pdf
Note- Can someone help me with the public boolean isEmpty()- public bo.pdfNote- Can someone help me with the public boolean isEmpty()- public bo.pdf
Note- Can someone help me with the public boolean isEmpty()- public bo.pdfAugstore
 
please read below it will tell you what we are using L.pdf
please read below it will tell you what we are using   L.pdfplease read below it will tell you what we are using   L.pdf
please read below it will tell you what we are using L.pdfankit11134
 
please read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdfplease read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdfaggarwalopticalsco
 
import static org.junit.Assert.;import java.util.Arrays; import.pdf
import static org.junit.Assert.;import java.util.Arrays; import.pdfimport static org.junit.Assert.;import java.util.Arrays; import.pdf
import static org.junit.Assert.;import java.util.Arrays; import.pdfsudheerforce
 
Hi,I have added the methods and main class as per your requirement.pdf
Hi,I have added the methods and main class as per your requirement.pdfHi,I have added the methods and main class as per your requirement.pdf
Hi,I have added the methods and main class as per your requirement.pdfannaelctronics
 
So I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdfSo I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdfaksahnan
 
package singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdfpackage singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdfamazing2001
 
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...davidwarner122
 
import java.util.Iterator; import java.util.NoSuchElementException; .pdf
  import java.util.Iterator; import java.util.NoSuchElementException; .pdf  import java.util.Iterator; import java.util.NoSuchElementException; .pdf
import java.util.Iterator; import java.util.NoSuchElementException; .pdfdeepakangel
 
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdfImplement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdfrishabjain5053
 
Modifications highlighted in bold lettersDropOutStack.javaim.pdf
Modifications highlighted in bold lettersDropOutStack.javaim.pdfModifications highlighted in bold lettersDropOutStack.javaim.pdf
Modifications highlighted in bold lettersDropOutStack.javaim.pdfLalkamal2
 
package ADTs public interface CollectionADTltTgt .pdf
package ADTs public interface CollectionADTltTgt      .pdfpackage ADTs public interface CollectionADTltTgt      .pdf
package ADTs public interface CollectionADTltTgt .pdfsyedabdul78662
 
Implementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdfImplementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdfmaheshkumar12354
 
Note- Can someone help me with the Public boolean add(E value) method.pdf
Note- Can someone help me with the Public boolean add(E value) method.pdfNote- Can someone help me with the Public boolean add(E value) method.pdf
Note- Can someone help me with the Public boolean add(E value) method.pdfStewart29UReesa
 

Similar to import java.util.ArrayList; import java.util.List; .pdf (20)

Lecture 18Dynamic Data Structures and Generics (II).docx
Lecture 18Dynamic Data Structures and Generics (II).docxLecture 18Dynamic Data Structures and Generics (II).docx
Lecture 18Dynamic Data Structures and Generics (II).docx
 
Please complete all the code as per instructions in Java programming.docx
Please complete all the code as per instructions in Java programming.docxPlease complete all the code as per instructions in Java programming.docx
Please complete all the code as per instructions in Java programming.docx
 
Please do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdfPlease do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdf
 
Please help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdfPlease help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdf
 
Java Generics
Java GenericsJava Generics
Java Generics
 
For this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdfFor this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdf
 
Note- Can someone help me with the public boolean isEmpty()- public bo.pdf
Note- Can someone help me with the public boolean isEmpty()- public bo.pdfNote- Can someone help me with the public boolean isEmpty()- public bo.pdf
Note- Can someone help me with the public boolean isEmpty()- public bo.pdf
 
please read below it will tell you what we are using L.pdf
please read below it will tell you what we are using   L.pdfplease read below it will tell you what we are using   L.pdf
please read below it will tell you what we are using L.pdf
 
please read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdfplease read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdf
 
import static org.junit.Assert.;import java.util.Arrays; import.pdf
import static org.junit.Assert.;import java.util.Arrays; import.pdfimport static org.junit.Assert.;import java.util.Arrays; import.pdf
import static org.junit.Assert.;import java.util.Arrays; import.pdf
 
Hi,I have added the methods and main class as per your requirement.pdf
Hi,I have added the methods and main class as per your requirement.pdfHi,I have added the methods and main class as per your requirement.pdf
Hi,I have added the methods and main class as per your requirement.pdf
 
So I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdfSo I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdf
 
package singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdfpackage singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdf
 
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
 
import java.util.Iterator; import java.util.NoSuchElementException; .pdf
  import java.util.Iterator; import java.util.NoSuchElementException; .pdf  import java.util.Iterator; import java.util.NoSuchElementException; .pdf
import java.util.Iterator; import java.util.NoSuchElementException; .pdf
 
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdfImplement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
 
Modifications highlighted in bold lettersDropOutStack.javaim.pdf
Modifications highlighted in bold lettersDropOutStack.javaim.pdfModifications highlighted in bold lettersDropOutStack.javaim.pdf
Modifications highlighted in bold lettersDropOutStack.javaim.pdf
 
package ADTs public interface CollectionADTltTgt .pdf
package ADTs public interface CollectionADTltTgt      .pdfpackage ADTs public interface CollectionADTltTgt      .pdf
package ADTs public interface CollectionADTltTgt .pdf
 
Implementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdfImplementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdf
 
Note- Can someone help me with the Public boolean add(E value) method.pdf
Note- Can someone help me with the Public boolean add(E value) method.pdfNote- Can someone help me with the Public boolean add(E value) method.pdf
Note- Can someone help me with the Public boolean add(E value) method.pdf
 

More from anuradhasilks

The Arrhenius Theory of acids and bases The theo.pdf
                     The Arrhenius Theory of acids and bases  The theo.pdf                     The Arrhenius Theory of acids and bases  The theo.pdf
The Arrhenius Theory of acids and bases The theo.pdfanuradhasilks
 
oxygen in air (O2) reacts with H2 when it burns .pdf
                     oxygen in air (O2) reacts with H2 when it burns  .pdf                     oxygen in air (O2) reacts with H2 when it burns  .pdf
oxygen in air (O2) reacts with H2 when it burns .pdfanuradhasilks
 
most of the hydrogens on the benzene were replace.pdf
                     most of the hydrogens on the benzene were replace.pdf                     most of the hydrogens on the benzene were replace.pdf
most of the hydrogens on the benzene were replace.pdfanuradhasilks
 
Li2S Solution Li2S .pdf
                     Li2S  Solution                     Li2S  .pdf                     Li2S  Solution                     Li2S  .pdf
Li2S Solution Li2S .pdfanuradhasilks
 
identical is the exact same, this is the top r.pdf
                     identical is the exact same, this is the top r.pdf                     identical is the exact same, this is the top r.pdf
identical is the exact same, this is the top r.pdfanuradhasilks
 
This is a nucleophilic substitution reaction that.pdf
                     This is a nucleophilic substitution reaction that.pdf                     This is a nucleophilic substitution reaction that.pdf
This is a nucleophilic substitution reaction that.pdfanuradhasilks
 
Sulfur is oxidized and nitrogen is reduced. .pdf
                     Sulfur is oxidized and nitrogen is reduced.      .pdf                     Sulfur is oxidized and nitrogen is reduced.      .pdf
Sulfur is oxidized and nitrogen is reduced. .pdfanuradhasilks
 
TriangleU210.javapublic class TriangleU210 {    Declaring inst.pdf
TriangleU210.javapublic class TriangleU210 {    Declaring inst.pdfTriangleU210.javapublic class TriangleU210 {    Declaring inst.pdf
TriangleU210.javapublic class TriangleU210 {    Declaring inst.pdfanuradhasilks
 
There is some data missing in the problem.The composition of the m.pdf
There is some data missing in the problem.The composition of the m.pdfThere is some data missing in the problem.The composition of the m.pdf
There is some data missing in the problem.The composition of the m.pdfanuradhasilks
 
at beginning flask has only NaOH pH = 14 + log [N.pdf
                     at beginning flask has only NaOH pH = 14 + log [N.pdf                     at beginning flask has only NaOH pH = 14 + log [N.pdf
at beginning flask has only NaOH pH = 14 + log [N.pdfanuradhasilks
 
take log on both sides1n lna = ln las a--0.pdf
take log on both sides1n lna = ln las a--0.pdftake log on both sides1n lna = ln las a--0.pdf
take log on both sides1n lna = ln las a--0.pdfanuradhasilks
 
Tested on Eclipse and both class should be in same packageimport.pdf
Tested on Eclipse and both class should be in same packageimport.pdfTested on Eclipse and both class should be in same packageimport.pdf
Tested on Eclipse and both class should be in same packageimport.pdfanuradhasilks
 
Solution A person in perfect health has a utility score of 1.0U.pdf
Solution A person in perfect health has a utility score of 1.0U.pdfSolution A person in perfect health has a utility score of 1.0U.pdf
Solution A person in perfect health has a utility score of 1.0U.pdfanuradhasilks
 
Resurgent infection is suggesting that it is viral infection by meas.pdf
Resurgent infection is suggesting that it is viral infection by meas.pdfResurgent infection is suggesting that it is viral infection by meas.pdf
Resurgent infection is suggesting that it is viral infection by meas.pdfanuradhasilks
 
There are only two functional groups in the molec.pdf
                     There are only two functional groups in the molec.pdf                     There are only two functional groups in the molec.pdf
There are only two functional groups in the molec.pdfanuradhasilks
 
PsychoanalysisPsychoanalysis was founded by Sigmund Freud (1856-19.pdf
PsychoanalysisPsychoanalysis was founded by Sigmund Freud (1856-19.pdfPsychoanalysisPsychoanalysis was founded by Sigmund Freud (1856-19.pdf
PsychoanalysisPsychoanalysis was founded by Sigmund Freud (1856-19.pdfanuradhasilks
 
Product of Cyclopentane + H2O(H+) gives No Reaction.It will simply F.pdf
Product of Cyclopentane + H2O(H+) gives No Reaction.It will simply F.pdfProduct of Cyclopentane + H2O(H+) gives No Reaction.It will simply F.pdf
Product of Cyclopentane + H2O(H+) gives No Reaction.It will simply F.pdfanuradhasilks
 
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdfOf the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdfanuradhasilks
 
C2O2 is a bidendate ligand &Cl - is a mono dendat.pdf
                     C2O2 is a bidendate ligand &Cl - is a mono dendat.pdf                     C2O2 is a bidendate ligand &Cl - is a mono dendat.pdf
C2O2 is a bidendate ligand &Cl - is a mono dendat.pdfanuradhasilks
 

More from anuradhasilks (20)

The Arrhenius Theory of acids and bases The theo.pdf
                     The Arrhenius Theory of acids and bases  The theo.pdf                     The Arrhenius Theory of acids and bases  The theo.pdf
The Arrhenius Theory of acids and bases The theo.pdf
 
oxygen in air (O2) reacts with H2 when it burns .pdf
                     oxygen in air (O2) reacts with H2 when it burns  .pdf                     oxygen in air (O2) reacts with H2 when it burns  .pdf
oxygen in air (O2) reacts with H2 when it burns .pdf
 
x+12=1 x=12 .pdf
                     x+12=1 x=12                                    .pdf                     x+12=1 x=12                                    .pdf
x+12=1 x=12 .pdf
 
most of the hydrogens on the benzene were replace.pdf
                     most of the hydrogens on the benzene were replace.pdf                     most of the hydrogens on the benzene were replace.pdf
most of the hydrogens on the benzene were replace.pdf
 
Li2S Solution Li2S .pdf
                     Li2S  Solution                     Li2S  .pdf                     Li2S  Solution                     Li2S  .pdf
Li2S Solution Li2S .pdf
 
identical is the exact same, this is the top r.pdf
                     identical is the exact same, this is the top r.pdf                     identical is the exact same, this is the top r.pdf
identical is the exact same, this is the top r.pdf
 
This is a nucleophilic substitution reaction that.pdf
                     This is a nucleophilic substitution reaction that.pdf                     This is a nucleophilic substitution reaction that.pdf
This is a nucleophilic substitution reaction that.pdf
 
Sulfur is oxidized and nitrogen is reduced. .pdf
                     Sulfur is oxidized and nitrogen is reduced.      .pdf                     Sulfur is oxidized and nitrogen is reduced.      .pdf
Sulfur is oxidized and nitrogen is reduced. .pdf
 
TriangleU210.javapublic class TriangleU210 {    Declaring inst.pdf
TriangleU210.javapublic class TriangleU210 {    Declaring inst.pdfTriangleU210.javapublic class TriangleU210 {    Declaring inst.pdf
TriangleU210.javapublic class TriangleU210 {    Declaring inst.pdf
 
There is some data missing in the problem.The composition of the m.pdf
There is some data missing in the problem.The composition of the m.pdfThere is some data missing in the problem.The composition of the m.pdf
There is some data missing in the problem.The composition of the m.pdf
 
at beginning flask has only NaOH pH = 14 + log [N.pdf
                     at beginning flask has only NaOH pH = 14 + log [N.pdf                     at beginning flask has only NaOH pH = 14 + log [N.pdf
at beginning flask has only NaOH pH = 14 + log [N.pdf
 
take log on both sides1n lna = ln las a--0.pdf
take log on both sides1n lna = ln las a--0.pdftake log on both sides1n lna = ln las a--0.pdf
take log on both sides1n lna = ln las a--0.pdf
 
Tested on Eclipse and both class should be in same packageimport.pdf
Tested on Eclipse and both class should be in same packageimport.pdfTested on Eclipse and both class should be in same packageimport.pdf
Tested on Eclipse and both class should be in same packageimport.pdf
 
Solution A person in perfect health has a utility score of 1.0U.pdf
Solution A person in perfect health has a utility score of 1.0U.pdfSolution A person in perfect health has a utility score of 1.0U.pdf
Solution A person in perfect health has a utility score of 1.0U.pdf
 
Resurgent infection is suggesting that it is viral infection by meas.pdf
Resurgent infection is suggesting that it is viral infection by meas.pdfResurgent infection is suggesting that it is viral infection by meas.pdf
Resurgent infection is suggesting that it is viral infection by meas.pdf
 
There are only two functional groups in the molec.pdf
                     There are only two functional groups in the molec.pdf                     There are only two functional groups in the molec.pdf
There are only two functional groups in the molec.pdf
 
PsychoanalysisPsychoanalysis was founded by Sigmund Freud (1856-19.pdf
PsychoanalysisPsychoanalysis was founded by Sigmund Freud (1856-19.pdfPsychoanalysisPsychoanalysis was founded by Sigmund Freud (1856-19.pdf
PsychoanalysisPsychoanalysis was founded by Sigmund Freud (1856-19.pdf
 
Product of Cyclopentane + H2O(H+) gives No Reaction.It will simply F.pdf
Product of Cyclopentane + H2O(H+) gives No Reaction.It will simply F.pdfProduct of Cyclopentane + H2O(H+) gives No Reaction.It will simply F.pdf
Product of Cyclopentane + H2O(H+) gives No Reaction.It will simply F.pdf
 
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdfOf the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
 
C2O2 is a bidendate ligand &Cl - is a mono dendat.pdf
                     C2O2 is a bidendate ligand &Cl - is a mono dendat.pdf                     C2O2 is a bidendate ligand &Cl - is a mono dendat.pdf
C2O2 is a bidendate ligand &Cl - is a mono dendat.pdf
 

Recently uploaded

Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 

Recently uploaded (20)

Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 

import java.util.ArrayList; import java.util.List; .pdf

  • 1. import java.util.ArrayList; import java.util.List; /** * * */ public class AList { List list = new ArrayList(); public AList() { // TODO Auto-generated constructor stub } /** * */ public AList(List list) { this.list = list; } /* * (non-Javadoc) * * see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { // TODO Auto-generated method stub AList aList = (AList) obj; List arrayList = aList.getList(); if (arrayList.size() != list.size()) { return false; } for (int i = 0; i < list.size(); i++) { if (list.get(i) != arrayList.get(i)) { return false; } }
  • 2. return true; } /** * return the list */ public List getList() { return list; } /** * param list * the list to set */ public void setList(List list) { this.list = list; } /** * param args */ public static void main(String[] args) { // TODO Auto-generated method stub List integers = new ArrayList(); integers.add(10); integers.add(20); integers.add(30); integers.add(40); integers.add(50); List integers1 = new ArrayList(); integers1.add(10); integers1.add(20); integers1.add(30); integers1.add(40); integers1.add(60); AList aList1 = new AList(integers); AList aList2 = new AList(integers); System.out.println("list1 and list2 are equal? " + aList1.equals(aList2));
  • 3. aList2 = new AList(integers1); System.out .println("After adding 60 to list2, list1 and list2 are not equal? " + aList1.equals(aList2)); } } OUTPUT: list1 and list2 are equal? true After adding 60 to list2, list1 and list2 are not equal? false Solution import java.util.ArrayList; import java.util.List; /** * * */ public class AList { List list = new ArrayList(); public AList() { // TODO Auto-generated constructor stub } /** * */ public AList(List list) { this.list = list; } /* * (non-Javadoc) * * see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) {
  • 4. // TODO Auto-generated method stub AList aList = (AList) obj; List arrayList = aList.getList(); if (arrayList.size() != list.size()) { return false; } for (int i = 0; i < list.size(); i++) { if (list.get(i) != arrayList.get(i)) { return false; } } return true; } /** * return the list */ public List getList() { return list; } /** * param list * the list to set */ public void setList(List list) { this.list = list; } /** * param args */ public static void main(String[] args) { // TODO Auto-generated method stub List integers = new ArrayList(); integers.add(10); integers.add(20); integers.add(30); integers.add(40);
  • 5. integers.add(50); List integers1 = new ArrayList(); integers1.add(10); integers1.add(20); integers1.add(30); integers1.add(40); integers1.add(60); AList aList1 = new AList(integers); AList aList2 = new AList(integers); System.out.println("list1 and list2 are equal? " + aList1.equals(aList2)); aList2 = new AList(integers1); System.out .println("After adding 60 to list2, list1 and list2 are not equal? " + aList1.equals(aList2)); } } OUTPUT: list1 and list2 are equal? true After adding 60 to list2, list1 and list2 are not equal? false