Deciding Which Collection to Use: Java Collections Framework Video Tutorial, Part 12
How to decide which collection to use. Not only is this the first thing anyone needs to know when they’re planning to use a Java Collections class, but it’s also a favourite question of interviewers and examiners (although quite not … Continue reading
Implementing Iterable; Downloading HTML Using Java: Java Collections Framework Video Tutorial, Part 11
How and why to implement Iterable and Iterator in Java, with an example of downloading HTML in Java while iterating through a “for-each” loop. After starting the video, click the maximise button to make it fullscreen so you can see … Continue reading
Using Iterators: Java Collections Framework Video Tutorial, Part 10
A look at using iterators in Java; how “for each” loops work and how to add or remove elements from a list while iterating through it. After starting the video, click the maximise button to make it fullscreen so you … Continue reading
Queues: Java Collections Framework Video Tutorial, Part 9
A tutorial on the Java Queue interface, plus a couple of examples of Queues and a bit about the highly-useful (if you’re into multithreading) BlockingQueue interface. After starting the video, click the maximise button to make it fullscreen so you … Continue reading
Natural Ordering and the Comparable Interface: Java Collections Framework Video Tutorial, Part 8
Learn how to give your classes a “natural order”. A tutorial on ordering your objects in TreeSets and TreeMaps and with Collections.sort() for Lists, using the Comparable Interface. In this tutorial I also take a look at the Collection interface … Continue reading
Sorting Lists Using Comparators: Java Collections Framework Video Tutorial, Part 7
A tutorial on sorting ArrayLists and other lists using the Comparator interface. In this tutorial you’ll learn how to sort your Java lists in an arbitrary order. After starting the video, click the maximise button to make it fullscreen so … Continue reading
Using Custom Objects in Sets and as Map Keys: Java Collections Framework Video Tutorial, Part 6
A tutorial on using your own objects as keys in Maps or in Sets. To use your own objects as keys in Maps or in Sets you need to tell Java how to compare your objects, by implementing the hashCode() … Continue reading
HashSet and Sets: Java Collections Framework Video Tutorial, Part 5
A tutorial on sets in Java; in this tutorial I show you how to use HashSet, TreeSet and LinkedHashSet, plus how to use the Set interface methods and how to do stuff like finding the intersection of two sets. After … Continue reading
Sorted Maps: Java Collections Framework Video Tutorial, Part 4
A tutorial on sorted maps in Java, plus some explanation of the Map interface and interfaces in general. After starting the video, click the maximise button to make it fullscreen so you can see the code! Code For This Tutorial … Continue reading
HashMap: Java Collections Framework Video Tutorial, Part 3
A tutorial on HashMap. Maps are data collections that function like lookup tables; basically you can store objects via “keys” (names, IDs, or even complex objects) and quickly retrieve them without having to look through an entire list. After starting … Continue reading
LinkedList: Java Collections Framework Video Tutorial, Part 2
The second part of the tutorial series on the Java Collections Framework; in this tutorial I explain when to use LinkedList rather than ArrayList; we look at how the two classes work internally and I also explain a bit about … Continue reading
ArrayList: Java Collections Framework Video Tutorial, Part 1
The first part of a series on the Java Collections Framework, an absolutely vital set of classes for organising data in your code. In this part we’ll look at ArrayList; an expandable array. ArrayList is probably the most used and … Continue reading