Java Collections Tutorial

preview_player
Показать описание
Learn all about Java Collections and write Java code with confidence!

⭐️ Want to learn more from me? Check out these links:

#Java #Programming
Рекомендации по теме
Комментарии
Автор

Somehow you manage to make videos that fit just along side my curriculum of coding for beginners in my computer science degree. Really nicely explained, and helps me grasp the concept better! Thanks Mosh

nicolai
Автор

Be blessed Mosh Plus everyone else learning code through Mosh

steinbeats
Автор

You are absolutely very good teacher and programmmer.

bubakrSiddiq
Автор

'Mosh' means buffalo in bengali! Thank you so much sir for helping us so much ! i am a kid learning python from your online course and enjoying it as well!

saibalmukherjee
Автор

I started the video asking myself why i couldnt use the for each with the genericList. i start stackoverflowding not getting a good answer. little did i know the whole purpose of the video was explaning exactly that 🤣. Your way of teaching is very intuitive. i usually use your videos to understand and then complement with books once i do understand to get the intricacies of each topic.

MrCrackheadst
Автор

This is exactly what I needed to learn next! Thanks so much Mosh! 😁

insighted
Автор

Thanks for your work, Mosh! Well done!

svetlanamazhaykina
Автор

I am a big fan of mosh because of him i learnt python free that's happy

pavaniduvvuri
Автор

Hi Mosh, Thank you for all the tutorials especially C#, i just finished your whole course on MVC 5. Please make also a Course on WPF C#, you have the best teaching method and style here in YT, so clear and precise and whats great is it is for real world scenarios as i just got hired as a 'no experience' developer and these tutorials helped me a lot. Thanks again and God Bless you and your family. 🙏

orisit
Автор

I've learnt more than alot from your videos

please!! can you do a video on Open3d python?!🙏🙏🙏🙏

leqalcoding
Автор

Thank you mosh


Ur Videos are good 👍

mohanbabu.d
Автор

*I would like to know about your next course details*

bharat_thapa_
Автор

Thank you for making this video. Your examples are clear and easy to understand.

longkesh
Автор

After seeing kotlin syntax i think java is still clear and straight forward

UmerFarooq-vkbe
Автор

I'm learning and using Java 8, but I wish I had that var keyword!! Nice video, thanks.

dembro
Автор

uncanny timing - badly needed this one and couldn't have come from a better teacher :)

aces
Автор

Thank you for this, please touch on advanced java as a course. Thank you

erichopeprince
Автор

Sir kindly make a video that complete react js course in latest version like functional components

umairnaveed
Автор

A great flow and good explanation to understand the lesson clearly...

TecICTian
Автор

- [00:33] 📚 Java Collections Framework Overview

- Overview of the Java Collections Framework hierarchy: interfaces represented by green boxes and classes by blue boxes.
- Hierarchy breakdown: `Iterable` interface, `Collection` interface, and sub-interfaces (`List`, `Queue`, `Set`) with added functionalities.
- Explanations on common operations declared in the `Collection` interface and their significance.

- [03:37] 🎶 Iterable Interface's Purpose and Problem Resolution

- Understanding the `Iterable` interface: its place in Java, functionality for iteration over objects.
- Demonstrating a problem with iterating over a generic list, highlighting issues with exposing internal implementations.
- Analogies with remote controls and encapsulation in object-oriented programming.

- [07:41] 🔍 Benefits of Implementing the Iterable Interface

- Exploring the benefits of implementing the `Iterable` interface: independence from internal implementations.
- Details on the `Iterator` interface and its role in simplifying iteration over collections.
- Demonstrating the conversion of a for-each loop into iterator operations via Java compilation.

- [09:02] 🧩 Implementing the Iterator Interface

- Step-by-step implementation of the `Iterator` interface within the `GenericList` class.
- Construction of a private nested class, `ListIterator`, and methods (`hasNext`, `next`) for iteration control.
- Enabling iteration over a generic list without exposing its internal structure.

- [13:06] 📦 Collection Interface Introduction

- Introduction to the `Collection` interface: its representation as a container for objects.
- Explanation of essential operations (`add`, `remove`, `contains`, etc.) declared in the `Collection` interface.
- Insight into extending the `Iterable` interface and common implementations like `ArrayList`.

- [20:00] 📂 Demonstrating Collection Interface Operations

- Implementation examples using the `Collection` interface within the `CollectionsDemo` class.
- Methods for adding, iterating, removing, checking existence, and converting collections to arrays.
- Utilizing utility methods like `addAll`, `size`, `clear`, and others within the `Collection` interface.

- [23:50] 📚 Converting Collection to String Array

- Converting a collection to a string array allows access to string methods.
- Utilizing `collection.toArray()` with a specified array type permits access to string methods easily.
- Utilizing `var` simplifies code readability despite arguments against its usage due to clarity in object type identification.

- [25:40] 🔍 Comparing Collections

- Comparing two collections for equality using `collection.equals(other)` compares their memory references.
- Checking for identical content between collections is done through `collection.equals(other)` method, which compares their actual content.

- [28:02] 📋 Exploring List Interface

- The List interface manages ordered collections where accessing objects by index is crucial.
- List operations include adding, inserting, retrieving by index, and removing items at specific indices.
- Features such as `list.subList()` provide functionality to obtain a sublist from a List.

- [30:27] 🔍 Using List Interface Methods

- Methods like `list.remove(index)` in List interface allow removal by specific index, a feature absent in general collections.
- `list.indexOf()` and `list.lastIndexOf()` determine the first and last indices of an element, respectively, aiding in search operations.
- The `list.subList(from, to)` method extracts a section of the list between two specified indices.

Made with HARPA AI

bunyyilmaz