Java ArrayList

preview_player
Показать описание
This Java ArrayList tutorial teaches you how to add, remove, retrieve values, and traverse an ArrayList with a for-loop. You'll also understand the differences between an ArrayList and an array, including how to initialize and size it. Additionally, you'll learn how to store objects in ArrayLists and work around its limitations by using wrapper classes to store primitive types.

Aligned to AP Computer Science A

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

Smith Eric Clark Matthew Thomas Sharon

McCarthyHiram
Автор

i love the way you visually demonstrated step by step what exactly each line of code does. i wish universities or other youtubers thought more like this

arvinhamrah
Автор

This is so much better than the official ap course. man I hate most of the teachers there. They either speak so fast you can't hear clearly, or they are so slow that you wanna skip the course.

DoFliesCallUsWalks
Автор

Hello, I have a question on array lists.

I found this question in the 2015 AP Computer Science A exam; three different name (string) values were added to a new array list, namely Alex, Bob, and Carl.

There is a for loop that prints the values, but it also sets each value to "Alex" while doing it.

for (int k = 0; k < students.size(); k++)
{
System.out.print(students.set(k, "Alex") + " ");
}

According to the answer, the values are set to Alex after the actual values (Alex, Bob, and Carl) are printed. Why does this happen, and is it true?

theunknown