SlideShare a Scribd company logo
using Java
2015
Data Structure
Prepared by: Mahmoud Rafeek Al-farra
in Java
5. Array List
mfarra.cst.ps www.fb.com/MahmoudRFarra
Contents
Example
The ArrayList Class
Introduction
Comparison between Arrays and ArrayList
Introduction
mfarra.cst.ps www.fb.com/MahmoudRFarra
You can create an array to store objects. But, once
the array is created, its size is fixed.
Nevertheless, you can still use arrays to implement
dynamic data structures.
 The trick is to create a larger new array to replace
the current array, if the current array cannot hold new
elements in the list.
Introduction
mfarra.cst.ps www.fb.com/MahmoudRFarra
You can see an animated example from the following link:
http://www.cs.armstrong.edu/liang/animation/web/ArrayList.html
The ArrayList Class
mfarra.cst.ps www.fb.com/MahmoudRFarra
Java provides the ArrayList class, which can be used to
store an unlimited number of objects.
ArrayList is known as a generic class with a generic type E.
You can specify a concrete type to replace E when creating
an ArrayList.
For example:
ArrayList <String> cities = new ArrayList<> ();
The ArrayList Class
mfarra.cst.ps www.fb.com/MahmoudRFarra
Example: The ArrayList Class
mfarra.cst.ps www.fb.com/MahmoudRFarra
Example: The ArrayList Class
mfarra.cst.ps www.fb.com/MahmoudRFarra
Comparison between Arrays and ArrayList
mfarra.cst.ps www.fb.com/MahmoudRFarra
Array List
mfarra.cst.ps www.fb.com/MahmoudRFarra
The ArrayList is in the java.util package, it is imported in line 1.
Case Study: Develop a program that prompts the user to enter a
sequence of numbers and displays the distinct numbers in the
sequence. Assume that the input ends with 0 and 0 is not counted
as a number in the sequence. [ind, N.W]
using Java
2015
FB: M a h m o u d R F a r r a
YouTube: M a h m o u d R F a r
SlidesShare: mralfarra
Thank you

More Related Content

What's hot (19)

Stacks in data structure
Stacks in data structure
lodhran-hayat
 
Introduction to data structure
Introduction to data structure
Vivek Kumar Sinha
 
Data structure and its types.
Data structure and its types.
buyinstagramfollowersaustralia
 
Data structure and its types
Data structure and its types
Navtar Sidhu Brar
 
Data structure and its types
Data structure and its types
Navtar Sidhu Brar
 
Comp 220 i lab 6 overloaded operators lab report and source code
Comp 220 i lab 6 overloaded operators lab report and source code
pradesigali1
 
Java - Collections
Java - Collections
Amith jayasekara
 
Computer Science-Data Structures :Abstract DataType (ADT)
Computer Science-Data Structures :Abstract DataType (ADT)
St Mary's College,Thrissur,Kerala
 
Data structure & its types
Data structure & its types
Rameesha Sadaqat
 
Presentation on Data Structure
Presentation on Data Structure
A. N. M. Jubaer
 
Presentation on queue
Presentation on queue
Rojan Pariyar
 
Datastructureitstypes
Datastructureitstypes
soniasharmafdp
 
4 chapter3 list_stackqueuepart1
4 chapter3 list_stackqueuepart1
SSE_AndyLi
 
Chapter 3: basic sorting algorithms data structure
Chapter 3: basic sorting algorithms data structure
Mahmoud Alfarra
 
Chapter 4: basic search algorithms data structure
Chapter 4: basic search algorithms data structure
Mahmoud Alfarra
 
Java Linked List Tutorial | Edureka
Java Linked List Tutorial | Edureka
Edureka!
 
Matlab Organizing Data
Matlab Organizing Data
DataminingTools Inc
 
Data structure
Data structure
laraib kafeel
 
Data structures and algorithms lab4
Data structures and algorithms lab4
Bianca Teşilă
 
Stacks in data structure
Stacks in data structure
lodhran-hayat
 
Introduction to data structure
Introduction to data structure
Vivek Kumar Sinha
 
Data structure and its types
Data structure and its types
Navtar Sidhu Brar
 
Data structure and its types
Data structure and its types
Navtar Sidhu Brar
 
Comp 220 i lab 6 overloaded operators lab report and source code
Comp 220 i lab 6 overloaded operators lab report and source code
pradesigali1
 
Data structure & its types
Data structure & its types
Rameesha Sadaqat
 
Presentation on Data Structure
Presentation on Data Structure
A. N. M. Jubaer
 
Presentation on queue
Presentation on queue
Rojan Pariyar
 
4 chapter3 list_stackqueuepart1
4 chapter3 list_stackqueuepart1
SSE_AndyLi
 
Chapter 3: basic sorting algorithms data structure
Chapter 3: basic sorting algorithms data structure
Mahmoud Alfarra
 
Chapter 4: basic search algorithms data structure
Chapter 4: basic search algorithms data structure
Mahmoud Alfarra
 
Java Linked List Tutorial | Edureka
Java Linked List Tutorial | Edureka
Edureka!
 
Data structures and algorithms lab4
Data structures and algorithms lab4
Bianca Teşilă
 

Viewers also liked (20)

Arrays C#
Arrays C#
Raghuveer Guthikonda
 
Array data structure
Array data structure
maamir farooq
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
Aakash deep Singhal
 
Ap Power Point Chpt6
Ap Power Point Chpt6
dplunkett
 
L6 structure
L6 structure
mondalakash2012
 
01 05 - introduction xml
01 05 - introduction xml
Siva Kumar reddy Vasipally
 
linked list
linked list
Abbott
 
Introduction to data structure by anil dutt
Introduction to data structure by anil dutt
Anil Dutt
 
Data structure lecture 1
Data structure lecture 1
Kumar
 
stack and queue array implementation in java.
stack and queue array implementation in java.
CIIT Atd.
 
‫Chapter3 inheritance
‫Chapter3 inheritance
Mahmoud Alfarra
 
Method overloading
Method overloading
Lovely Professional University
 
Data Structure (Introduction to Data Structure)
Data Structure (Introduction to Data Structure)
Adam Mukharil Bachtiar
 
Data structures
Data structures
Lovely Professional University
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
Rai University
 
Trees data structure
Trees data structure
Mahmoud Alfarra
 
Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)
Adam Mukharil Bachtiar
 
Graphs data Structure
Graphs data Structure
Mahmoud Alfarra
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Hassan Ahmed
 
Basic data-structures-v.1.1
Basic data-structures-v.1.1
BG Java EE Course
 
Array data structure
Array data structure
maamir farooq
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
Aakash deep Singhal
 
Ap Power Point Chpt6
Ap Power Point Chpt6
dplunkett
 
linked list
linked list
Abbott
 
Introduction to data structure by anil dutt
Introduction to data structure by anil dutt
Anil Dutt
 
Data structure lecture 1
Data structure lecture 1
Kumar
 
stack and queue array implementation in java.
stack and queue array implementation in java.
CIIT Atd.
 
Data Structure (Introduction to Data Structure)
Data Structure (Introduction to Data Structure)
Adam Mukharil Bachtiar
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
Rai University
 
Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)
Adam Mukharil Bachtiar
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Hassan Ahmed
 
Ad

Similar to 5 Array List, data structure course (20)

Lecture 9
Lecture 9
talha ijaz
 
Collections in Java Interview Questions PDF By ScholarHat
Collections in Java Interview Questions PDF By ScholarHat
Scholarhat
 
Java Arrays
Java Arrays
OXUS 20
 
Java Collections Tutorials
Java Collections Tutorials
Prof. Erwin Globio
 
24 collections framework interview questions
24 collections framework interview questions
Arun Vasanth
 
ArrayList in JAVA
ArrayList in JAVA
SAGARDAVE29
 
ArrayList in JAVA
ArrayList in JAVA
SAGARDAVE29
 
OCA Java SE 8 Exam Chapter 3 Core Java APIs
OCA Java SE 8 Exam Chapter 3 Core Java APIs
İbrahim Kürce
 
Introduction to es6
Introduction to es6
NexThoughts Technologies
 
5 collection framework
5 collection framework
Minal Maniar
 
List interface in collections framework
List interface in collections framework
Ravi Chythanya
 
Learn java
Learn java
Palahuja
 
Java collections
Java collections
padmad2291
 
Md08 collection api
Md08 collection api
Rakesh Madugula
 
Discuss the characteristics of ArrayList, LinkedList, and Vector and.pdf
Discuss the characteristics of ArrayList, LinkedList, and Vector and.pdf
info785431
 
DataStructureLists Stacks Queues and more
DataStructureLists Stacks Queues and more
ssuser69ff25
 
dataStructure Course about lists stacks queues and more
dataStructure Course about lists stacks queues and more
ssuser69ff25
 
Java interview questions 2
Java interview questions 2
Sherihan Anver
 
VTUOOPMCA5THMODULECollection OverV .pptx
VTUOOPMCA5THMODULECollection OverV .pptx
VeenaNaik23
 
mca5thCollection OverViCollection O.pptx
mca5thCollection OverViCollection O.pptx
VeenaNaik23
 
Collections in Java Interview Questions PDF By ScholarHat
Collections in Java Interview Questions PDF By ScholarHat
Scholarhat
 
Java Arrays
Java Arrays
OXUS 20
 
24 collections framework interview questions
24 collections framework interview questions
Arun Vasanth
 
ArrayList in JAVA
ArrayList in JAVA
SAGARDAVE29
 
ArrayList in JAVA
ArrayList in JAVA
SAGARDAVE29
 
OCA Java SE 8 Exam Chapter 3 Core Java APIs
OCA Java SE 8 Exam Chapter 3 Core Java APIs
İbrahim Kürce
 
5 collection framework
5 collection framework
Minal Maniar
 
List interface in collections framework
List interface in collections framework
Ravi Chythanya
 
Learn java
Learn java
Palahuja
 
Java collections
Java collections
padmad2291
 
Discuss the characteristics of ArrayList, LinkedList, and Vector and.pdf
Discuss the characteristics of ArrayList, LinkedList, and Vector and.pdf
info785431
 
DataStructureLists Stacks Queues and more
DataStructureLists Stacks Queues and more
ssuser69ff25
 
dataStructure Course about lists stacks queues and more
dataStructure Course about lists stacks queues and more
ssuser69ff25
 
Java interview questions 2
Java interview questions 2
Sherihan Anver
 
VTUOOPMCA5THMODULECollection OverV .pptx
VTUOOPMCA5THMODULECollection OverV .pptx
VeenaNaik23
 
mca5thCollection OverViCollection O.pptx
mca5thCollection OverViCollection O.pptx
VeenaNaik23
 
Ad

More from Mahmoud Alfarra (20)

Computer Programming, Loops using Java - part 2
Computer Programming, Loops using Java - part 2
Mahmoud Alfarra
 
Computer Programming, Loops using Java
Computer Programming, Loops using Java
Mahmoud Alfarra
 
Chapter9 graph data structure
Chapter9 graph data structure
Mahmoud Alfarra
 
Chapter 8: tree data structure
Chapter 8: tree data structure
Mahmoud Alfarra
 
Chapter 7: Queue data structure
Chapter 7: Queue data structure
Mahmoud Alfarra
 
Chapter 6: stack data structure
Chapter 6: stack data structure
Mahmoud Alfarra
 
Chapter 5: linked list data structure
Chapter 5: linked list data structure
Mahmoud Alfarra
 
Chapter 2: array and array list data structure
Chapter 2: array and array list data structure
Mahmoud Alfarra
 
Chapter1 intro toprincipleofc#_datastructure_b_cs
Chapter1 intro toprincipleofc#_datastructure_b_cs
Mahmoud Alfarra
 
Chapter 0: introduction to data structure
Chapter 0: introduction to data structure
Mahmoud Alfarra
 
3 classification
3 classification
Mahmoud Alfarra
 
8 programming-using-java decision-making practices 20102011
8 programming-using-java decision-making practices 20102011
Mahmoud Alfarra
 
7 programming-using-java decision-making220102011
7 programming-using-java decision-making220102011
Mahmoud Alfarra
 
6 programming-using-java decision-making20102011-
6 programming-using-java decision-making20102011-
Mahmoud Alfarra
 
5 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop20102011
Mahmoud Alfarra
 
4 programming-using-java intro-tojava20102011
4 programming-using-java intro-tojava20102011
Mahmoud Alfarra
 
3 programming-using-java introduction-to computer
3 programming-using-java introduction-to computer
Mahmoud Alfarra
 
2 programming-using-java how to built application
2 programming-using-java how to built application
Mahmoud Alfarra
 
1 programming-using-java -introduction
1 programming-using-java -introduction
Mahmoud Alfarra
 
تلخيص النصوص تلقائيا
تلخيص النصوص تلقائيا
Mahmoud Alfarra
 
Computer Programming, Loops using Java - part 2
Computer Programming, Loops using Java - part 2
Mahmoud Alfarra
 
Computer Programming, Loops using Java
Computer Programming, Loops using Java
Mahmoud Alfarra
 
Chapter9 graph data structure
Chapter9 graph data structure
Mahmoud Alfarra
 
Chapter 8: tree data structure
Chapter 8: tree data structure
Mahmoud Alfarra
 
Chapter 7: Queue data structure
Chapter 7: Queue data structure
Mahmoud Alfarra
 
Chapter 6: stack data structure
Chapter 6: stack data structure
Mahmoud Alfarra
 
Chapter 5: linked list data structure
Chapter 5: linked list data structure
Mahmoud Alfarra
 
Chapter 2: array and array list data structure
Chapter 2: array and array list data structure
Mahmoud Alfarra
 
Chapter1 intro toprincipleofc#_datastructure_b_cs
Chapter1 intro toprincipleofc#_datastructure_b_cs
Mahmoud Alfarra
 
Chapter 0: introduction to data structure
Chapter 0: introduction to data structure
Mahmoud Alfarra
 
8 programming-using-java decision-making practices 20102011
8 programming-using-java decision-making practices 20102011
Mahmoud Alfarra
 
7 programming-using-java decision-making220102011
7 programming-using-java decision-making220102011
Mahmoud Alfarra
 
6 programming-using-java decision-making20102011-
6 programming-using-java decision-making20102011-
Mahmoud Alfarra
 
5 programming-using-java intro-tooop20102011
5 programming-using-java intro-tooop20102011
Mahmoud Alfarra
 
4 programming-using-java intro-tojava20102011
4 programming-using-java intro-tojava20102011
Mahmoud Alfarra
 
3 programming-using-java introduction-to computer
3 programming-using-java introduction-to computer
Mahmoud Alfarra
 
2 programming-using-java how to built application
2 programming-using-java how to built application
Mahmoud Alfarra
 
1 programming-using-java -introduction
1 programming-using-java -introduction
Mahmoud Alfarra
 
تلخيص النصوص تلقائيا
تلخيص النصوص تلقائيا
Mahmoud Alfarra
 

Recently uploaded (20)

Revista digital preescolar en transformación
Revista digital preescolar en transformación
guerragallardo26
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Pragya - UEM Kolkata Quiz Club
 
What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
Quiz Club of PSG College of Arts & Science
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Vikas Bansal Himachal Pradesh: A Visionary Transforming Himachal’s Educationa...
Vikas Bansal Himachal Pradesh: A Visionary Transforming Himachal’s Educationa...
Himalayan Group of Professional Institutions (HGPI)
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
Revista digital preescolar en transformación
Revista digital preescolar en transformación
guerragallardo26
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Pragya - UEM Kolkata Quiz Club
 
What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 

5 Array List, data structure course