Java Programming Tutorial 71 - Method to take an ArrayList of Custom Type

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

Just thought i'd put this out there, with updated versions of java (I believe java 4 and up) to make an a list you can simply write

List<User> users = new ArrayList<>();


rather than using

List<User> users = new ArrayList<User>();


This is because java knows that whatever is in the first < > so in this case User, it can also put it in the second without you having to write it. I hope this makes sense.

IgtKevin
Автор

My husband follows a YouTuber who got the license plate “NULL” to be funny. Well it turns out that if the person has no plates, officers enter NULL into that space. This guy starts getting letters about tons of tickets and fines that belong to NULL. It took a LOT of straightening out on that one. Lesson learned... don’t get that license plate or anything like it. 😂

lorimast
Автор

Instead of creating another static method in the User class, we could have used the existing getFullName, and put the for-loop in the main program instead, like this: for (User u : users) -> As a beginner at this, that seems easier, and requires less code actually, because we alreade had the getFullName-method. But maybe the static method was supposed to replace getFullName().

trumbaron
Автор

You stopped using the string arrays from video 67 (I think). Got a little confused with that.

monkeyseatcatfood
join shbcf.ru