SlideShare a Scribd company logo
Processing Data
in Collections
Chapter 13
13
Object Wrappers
Collections can only hold objects.
Primitive types (int, double, float,etc.)
are not objects.
Primitives must be wrapped in special
wrapper objects.
Wrappers exist for each of the eight
primitive types.
13
What is an iterator?
An iterator is an object that
encapsulates the ability to iterate
through or visit each element in the
collection.
13
Using the Iterator Interface
hasNext() method determines if there
are more elements in the array
next() method returns the next element
and advances the iterator
13
The DrawShapes Application
User clicks in applet window to create
one of three random shapes.
Each shape is added to a collection.
When user clicks in applet window, the
collection is checked to see if a “hit” is
registered on an existing shape.
When a “hit” occurs, the shape’s color
will change randomly.
13
The Shape Inheritance Hierarchy
Abstract class OurShape implements:
changeColorRandomly() to change the
color of an object by randomly selecting a
color
contains() to determine whether x, y
coordinates of a mouse click fall within a
shape’s boundaries
draw() to draw the shape at x, y
coordinates specified by a mouse click
13
Classes Derived from OurShape
OurRectangle
OurTriangle
OurCircle
13
What is a linked list?
A LinkedList is a more powerful data
structure that allows for quick and
easy insertion and removal of
elements.
13
Linked Lists
LinkedLists come in two types:
Singly linked list—each node knows only
the next node
Doubly linked list—each node knows both
the previous and the next node
13
What is a set?
A set is a collection with no duplicate
elements.
Programmer needs to determine what
constitutes a “duplicate.”
The equals() method can be used to
provide an additional definition of
equality.
13
HashSet
Based on a hash table, a HashSet is a
powerful data structure that can be
used to retrieve objects quickly in a set.
Unordered collection
A hash code is used to organize objects
in a HashSet
13
TreeSet
TreeSet provides the properties of a set in
a sorted collection.
Objects can be inserted in any order but are
retrieved in sorted order
Uses Comparable interface to compare objects
for sorting
Primitive types and String objects are
comparable
Up to programmer to implement the
compareTo() method for user-defined objects

More Related Content

What's hot

List interface
List interfaceList interface
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
Self-Employed
 
Slide 1.-datastructure
Slide 1.-datastructureSlide 1.-datastructure
Slide 1.-datastructure
Minhaz Leo
 
collections
 collections collections
Data structure lecture 2
Data structure lecture 2Data structure lecture 2
Data structure lecture 2
Abbott
 
General Data structures
General Data structuresGeneral Data structures
General Data structures
Youssef Elsalhawy
 
structures and unions in 'C'
structures and unions in 'C'structures and unions in 'C'
structures and unions in 'C'
illpa
 
2 introduction to data structure
2  introduction to data structure2  introduction to data structure
2 introduction to data structure
Mahmoud Alfarra
 
5 Array List, data structure course
5 Array List, data structure course5 Array List, data structure course
5 Array List, data structure course
Mahmoud Alfarra
 
Java collections
Java collectionsJava collections
Java collections
Sujit Kumar
 
Presentation on Data Structure
Presentation on Data StructurePresentation on Data Structure
Presentation on Data Structure
A. N. M. Jubaer
 
Orange Data Mining & Data Visualization Tool
Orange Data Mining & Data Visualization ToolOrange Data Mining & Data Visualization Tool
Orange Data Mining & Data Visualization Tool
Mithileysh Sathiyanarayanan
 
Java collections
Java collectionsJava collections
Java collections
padmad2291
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked list
Fahd Allebdi
 
R data types
R   data typesR   data types
R data types
Learnbay Datascience
 
Data structures
Data structuresData structures
Data structures
MADHAVASAIYENDUVA
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure
NUPOORAWSARMOL
 
Presentation of array
Presentation of arrayPresentation of array
Presentation of array
Shamim Hossain
 
Data struters
Data strutersData struters
Data struters
ashish bansal
 

What's hot (19)

List interface
List interfaceList interface
List interface
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
 
Slide 1.-datastructure
Slide 1.-datastructureSlide 1.-datastructure
Slide 1.-datastructure
 
collections
 collections collections
collections
 
Data structure lecture 2
Data structure lecture 2Data structure lecture 2
Data structure lecture 2
 
General Data structures
General Data structuresGeneral Data structures
General Data structures
 
structures and unions in 'C'
structures and unions in 'C'structures and unions in 'C'
structures and unions in 'C'
 
2 introduction to data structure
2  introduction to data structure2  introduction to data structure
2 introduction to data structure
 
5 Array List, data structure course
5 Array List, data structure course5 Array List, data structure course
5 Array List, data structure course
 
Java collections
Java collectionsJava collections
Java collections
 
Presentation on Data Structure
Presentation on Data StructurePresentation on Data Structure
Presentation on Data Structure
 
Orange Data Mining & Data Visualization Tool
Orange Data Mining & Data Visualization ToolOrange Data Mining & Data Visualization Tool
Orange Data Mining & Data Visualization Tool
 
Java collections
Java collectionsJava collections
Java collections
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked list
 
R data types
R   data typesR   data types
R data types
 
Data structures
Data structuresData structures
Data structures
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure
 
Presentation of array
Presentation of arrayPresentation of array
Presentation of array
 
Data struters
Data strutersData struters
Data struters
 

Viewers also liked

Chapter 16
Chapter 16Chapter 16
Chapter 16
Graham Royce
 
Chapter 17
Chapter 17Chapter 17
Chapter 17
Graham Royce
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
Graham Royce
 
Chapter 18
Chapter 18Chapter 18
Chapter 18
Graham Royce
 
Enterprise Skills
Enterprise SkillsEnterprise Skills
Enterprise Skills
Graham Royce
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
Graham Royce
 
Key enterprise skills
Key enterprise skillsKey enterprise skills
Key enterprise skills
Zone Glyndwr University
 

Viewers also liked (7)

Chapter 16
Chapter 16Chapter 16
Chapter 16
 
Chapter 17
Chapter 17Chapter 17
Chapter 17
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Chapter 18
Chapter 18Chapter 18
Chapter 18
 
Enterprise Skills
Enterprise SkillsEnterprise Skills
Enterprise Skills
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Key enterprise skills
Key enterprise skillsKey enterprise skills
Key enterprise skills
 

Similar to Chapter 13

oop lecture framework,list,maps,collection
oop lecture framework,list,maps,collectionoop lecture framework,list,maps,collection
oop lecture framework,list,maps,collection
ssuseredfbe9
 
Nature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptxNature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptx
IllllBikkySharmaIlll
 
ArrayList.docx
ArrayList.docxArrayList.docx
ArrayList.docx
veerendranath12
 
Java - Collections framework
Java - Collections frameworkJava - Collections framework
Java - Collections framework
Riccardo Cardin
 
Java collections-interview-questions
Java collections-interview-questionsJava collections-interview-questions
Java collections-interview-questions
yearninginjava
 
11000121065_NAITIK CHATTERJEE.ppt
11000121065_NAITIK CHATTERJEE.ppt11000121065_NAITIK CHATTERJEE.ppt
11000121065_NAITIK CHATTERJEE.ppt
NaitikChatterjee
 
Collection Framework-1.pptx
Collection Framework-1.pptxCollection Framework-1.pptx
Collection Framework-1.pptx
SarthakSrivastava70
 
Collections Api - Java
Collections Api - JavaCollections Api - Java
Collections Api - Java
Drishti Bhalla
 
Collections
CollectionsCollections
Collections
sagsharma
 
List interface in collections framework
List interface in collections frameworkList interface in collections framework
List interface in collections framework
Ravi Chythanya
 
Collections framework
Collections frameworkCollections framework
Collections framework
Anand Buddarapu
 
introduction_dst.pptx
introduction_dst.pptxintroduction_dst.pptx
introduction_dst.pptx
HammadTariq51
 
Collection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshanCollection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshan
Zeeshan Khan
 
javacollections.pdf
javacollections.pdfjavacollections.pdf
javacollections.pdf
ManojKandhasamy1
 
Collections in Java Notes
Collections in Java NotesCollections in Java Notes
Collections in Java Notes
Shalabh Chaudhary
 
Collection framework
Collection frameworkCollection framework
Collection framework
DilvarSingh2
 
Data structures in c#
Data structures in c#Data structures in c#
Data structures in c#
SivaSankar Gorantla
 
Core & advanced java classes in mumbai
Core & advanced java classes in mumbaiCore & advanced java classes in mumbai
Core & advanced java classes in mumbai
Vibrant Technologies & Computers
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
yarotos643
 
Java collections notes
Java collections notesJava collections notes
Java collections notes
Surendar Meesala
 

Similar to Chapter 13 (20)

oop lecture framework,list,maps,collection
oop lecture framework,list,maps,collectionoop lecture framework,list,maps,collection
oop lecture framework,list,maps,collection
 
Nature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptxNature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptx
 
ArrayList.docx
ArrayList.docxArrayList.docx
ArrayList.docx
 
Java - Collections framework
Java - Collections frameworkJava - Collections framework
Java - Collections framework
 
Java collections-interview-questions
Java collections-interview-questionsJava collections-interview-questions
Java collections-interview-questions
 
11000121065_NAITIK CHATTERJEE.ppt
11000121065_NAITIK CHATTERJEE.ppt11000121065_NAITIK CHATTERJEE.ppt
11000121065_NAITIK CHATTERJEE.ppt
 
Collection Framework-1.pptx
Collection Framework-1.pptxCollection Framework-1.pptx
Collection Framework-1.pptx
 
Collections Api - Java
Collections Api - JavaCollections Api - Java
Collections Api - Java
 
Collections
CollectionsCollections
Collections
 
List interface in collections framework
List interface in collections frameworkList interface in collections framework
List interface in collections framework
 
Collections framework
Collections frameworkCollections framework
Collections framework
 
introduction_dst.pptx
introduction_dst.pptxintroduction_dst.pptx
introduction_dst.pptx
 
Collection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshanCollection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshan
 
javacollections.pdf
javacollections.pdfjavacollections.pdf
javacollections.pdf
 
Collections in Java Notes
Collections in Java NotesCollections in Java Notes
Collections in Java Notes
 
Collection framework
Collection frameworkCollection framework
Collection framework
 
Data structures in c#
Data structures in c#Data structures in c#
Data structures in c#
 
Core & advanced java classes in mumbai
Core & advanced java classes in mumbaiCore & advanced java classes in mumbai
Core & advanced java classes in mumbai
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
 
Java collections notes
Java collections notesJava collections notes
Java collections notes
 

More from Graham Royce

Chapter 10
Chapter 10Chapter 10
Chapter 10
Graham Royce
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
Graham Royce
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
Graham Royce
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
Graham Royce
 
Chapter 06
Chapter 06Chapter 06
Chapter 06
Graham Royce
 
Chapter 05
Chapter 05Chapter 05
Chapter 05
Graham Royce
 
Chapter 04
Chapter 04Chapter 04
Chapter 04
Graham Royce
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
Graham Royce
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
Graham Royce
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
Graham Royce
 
13 java in oracle
13 java in oracle13 java in oracle
13 java in oracle
Graham Royce
 
Java tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo CahersiveenJava tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo Cahersiveen
Graham Royce
 
My 3 min pitch pack
My 3 min pitch packMy 3 min pitch pack
My 3 min pitch pack
Graham Royce
 
Things to do
Things to doThings to do
Things to do
Graham Royce
 
House in order
House in orderHouse in order
House in order
Graham Royce
 
Blank 10 all you need
Blank 10 all you needBlank 10 all you need
Blank 10 all you need
Graham Royce
 
Goals
GoalsGoals
Idea's1 only
Idea's1 onlyIdea's1 only
Idea's1 only
Graham Royce
 
New frontiers motivation
New frontiers motivationNew frontiers motivation
New frontiers motivation
Graham Royce
 
The only slides you need
The only slides you needThe only slides you need
The only slides you need
Graham Royce
 

More from Graham Royce (20)

Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
 
Chapter 06
Chapter 06Chapter 06
Chapter 06
 
Chapter 05
Chapter 05Chapter 05
Chapter 05
 
Chapter 04
Chapter 04Chapter 04
Chapter 04
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
13 java in oracle
13 java in oracle13 java in oracle
13 java in oracle
 
Java tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo CahersiveenJava tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo Cahersiveen
 
My 3 min pitch pack
My 3 min pitch packMy 3 min pitch pack
My 3 min pitch pack
 
Things to do
Things to doThings to do
Things to do
 
House in order
House in orderHouse in order
House in order
 
Blank 10 all you need
Blank 10 all you needBlank 10 all you need
Blank 10 all you need
 
Goals
GoalsGoals
Goals
 
Idea's1 only
Idea's1 onlyIdea's1 only
Idea's1 only
 
New frontiers motivation
New frontiers motivationNew frontiers motivation
New frontiers motivation
 
The only slides you need
The only slides you needThe only slides you need
The only slides you need
 

Recently uploaded

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 

Recently uploaded (20)

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 

Chapter 13

  • 2. 13 Object Wrappers Collections can only hold objects. Primitive types (int, double, float,etc.) are not objects. Primitives must be wrapped in special wrapper objects. Wrappers exist for each of the eight primitive types.
  • 3. 13 What is an iterator? An iterator is an object that encapsulates the ability to iterate through or visit each element in the collection.
  • 4. 13 Using the Iterator Interface hasNext() method determines if there are more elements in the array next() method returns the next element and advances the iterator
  • 5. 13 The DrawShapes Application User clicks in applet window to create one of three random shapes. Each shape is added to a collection. When user clicks in applet window, the collection is checked to see if a “hit” is registered on an existing shape. When a “hit” occurs, the shape’s color will change randomly.
  • 6. 13 The Shape Inheritance Hierarchy Abstract class OurShape implements: changeColorRandomly() to change the color of an object by randomly selecting a color contains() to determine whether x, y coordinates of a mouse click fall within a shape’s boundaries draw() to draw the shape at x, y coordinates specified by a mouse click
  • 7. 13 Classes Derived from OurShape OurRectangle OurTriangle OurCircle
  • 8. 13 What is a linked list? A LinkedList is a more powerful data structure that allows for quick and easy insertion and removal of elements.
  • 9. 13 Linked Lists LinkedLists come in two types: Singly linked list—each node knows only the next node Doubly linked list—each node knows both the previous and the next node
  • 10. 13 What is a set? A set is a collection with no duplicate elements. Programmer needs to determine what constitutes a “duplicate.” The equals() method can be used to provide an additional definition of equality.
  • 11. 13 HashSet Based on a hash table, a HashSet is a powerful data structure that can be used to retrieve objects quickly in a set. Unordered collection A hash code is used to organize objects in a HashSet
  • 12. 13 TreeSet TreeSet provides the properties of a set in a sorted collection. Objects can be inserted in any order but are retrieved in sorted order Uses Comparable interface to compare objects for sorting Primitive types and String objects are comparable Up to programmer to implement the compareTo() method for user-defined objects