Java Programming Tutorial 78 - Overload the Search to Take in a User Object

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


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

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

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

Great series. Keep up the good work! Your explanations for the concepts are very clear and easy to understand. Thank you!

robotgamer
Автор

Would have been nice to start with a clean slate instead of having the IDE clogged up with code that is unrelated to the current topic being explained.

kedrn
Автор

public static int searchList(List<User> users, user u)
{
for(int i = 0; i < users.size(); i++)
{
if(users.get(i).equals(u)
{
return i;
}
}
return -1;
}

joeloswin.j
Автор

Public static void searchList(List<User> users, User u) {
For (int I =0; i<users.size();i++{
If(users.get(i).equals (u) {
Return i;
}
}
Return - 1;
}

Victor-ktqn
Автор

This series just feels totally rushed. Literally 0 thought or effort gone into mixing the examples up, or at least clearing the example from previous video to get rid of some of the unrelated crap and building the example from scratch every few eps. Series went to shit after the massive gap halfway thru the series and feels like it was just botched together and chucked onto YouTube as quickly as poss with minimum effort..

CompOverInhrtnce
Автор

public static int searchList(List<User> users, User u) {
//*
for (int i = 0 ; i < users.size(); i++) {
if(users.get(i).equals(u)) {
return i;
}
}
return -1;
//*/
// searchList(users, u.getFullName());
}

I spent probably 10 -20 minutes trying to figure out why it was throwing an error that it was searching for an index outside if bounds when I had it search for an object that wasn't in the list. And it was all because I accidentally put a 0 instead of an i in i<users.size() 😭😆 I have no idea how I kept overlooking that even though I new the problem probably had to be in that line. lol

christianmetaldreamur
Автор

public static int searchList(List<User> users, User u) {
for(int i=0;i<users.size();i++) {
if(users.get(i).equals(u)) {
return i;
}
}
return -1;
}

yaqiongli