Комментарии:
how do you pass in?
ОтветитьLiterally I was crying after my class cause the teacher really did not explain as clear as this video. Honestly, thanks a million!🥰⭐
Ответитьthank you for explaining this in a way that works with my brain. I felt so dumb for so long where have you been
ОтветитьKarl 😂
ОтветитьThank you John for the video
Ответитьimport java.util.ArrayList;
import java.util.Arrays;
public class App{
public static void main(String[] args) {
String[] friends = {"Kevin", "Joseph"};
friends[0] = "Karl";
System.out.println(friends[0]);
System.out.println(friends.length);
System.out.println(Arrays.toString(friends));
ArrayList<String> friendsList =
new ArrayList<>(Arrays.asList("Kevin", "Joseph"));
friendsList.set(1, "Axel");
friendsList.add(2, "Mike");
friendsList.remove("Joseph");
System.out.println(friendsList.get(0));
System.out.println(friendsList.size());
System.out.println(friendsList.get(2));
System.out.println(friendsList);
}
}
What if when creating a array , I specify the size with a variable and then increment it later, will now be able to add more values ?
Eg:
int h= 10;
int[] arr= new int[h];
h+=1;
arr[10]=12;
as I was watching I thought "BUT-BUT you cant DO THAT!" and then you wrote "//you can't do that "
and i got just a nice ass dopamine hit, thank you.
Hi John. Thank you for these teachings. I really appreciate it.
If I may ask... Can you think of a case one would have to use an array.
Bruh
. Hope you gain a ton more subscribers asap.. ur the reason i started learning Java..
Great video
ОтветитьMr.John, passing the code you wrote in the first comment could be a great way to make hands dirty!
ОтветитьThanks for this video. I googled ArrayList and Linked list and got a LOT of sites but non of them made sense to me and a few of them just made me more confused.
Ответитьcorl
Ответитьyou are my hero man, I've been using fixed array my whole life, you're best than my professors in college
Ответитьsuper explained, with respect from Germany🙏
Ответитьstop wait
Why can't I delete items from an array?
The leetcode even shows how to insert an element to the beginning, end, and middle of an array, and how to delete these elements
I feel like he is calling me
ОтветитьClear explanation
ОтветитьCarl
ОтветитьYou shouldn't lie to people about printing arrays. It makes biased and lacking in credibility.
You literally said that ArrayList implements the Arrays.toString() method. Meaning that if you use Arrays.toString on your array, it will print just like the ArrayList. I thought you were trying to educate, not spread bias over such an arbitrary topic to be biased over.
It blew my mind when I learned that you can resize an array by making a copy of it with Arrays.copyOf().
Worked great for a solution where I needed to break an input string into parts, but some of the parts ended early.
If the scanner.nextLine() only made a String array of length 2, copyOf and resize it to 3!
Yeah, although showing the ArrayList implementation could be a little advanced for beginners, it could be a good strategy to learns about data structure and solution learning. Under the implementations, those are methos that manipulates arrays, so it would be even more clear to understand how ArrayList deals with this data structure. Anyways, good video for learning some basics
ОтветитьThanks again this is exactly what I needed coming from more user-friendly languages
ОтветитьMan, John! Thank you so much! I‘m about to start my first developer job and see your videos daily! You are so great help!!! Please keep going!
ОтветитьThanks John, perfect info. Sorry to Chris who got removed haha
ОтветитьThank you so much))
ОтветитьI’ve been using Collection Lists for so long, I forgot that the Java Array was fixed size! 😂 Thanks for the reminder.
ОтветитьOne main thing that arrays might have direct use for is situations where boxed types cause issues with getting the expected result (eg. - int vs Integer). Since arrays can use primitive types and array lists cannot it might be ideal to use an array instead in that situation despite the more tricky implementation. Not sure how to explain that any better but that might be a good topic to cover if you don't already have a video of that sort. Still poring over a lot of content here but loving this channel 😁
ОтветитьHi, John.
I had recently joined an ICT institute.
Please I kindly need your help with Java and the basics of the program that I can start with.
Please your advice will highly be helpful to me.
Thanks in anticipation.
I'm working on an adaptation of 2 REST API I did on Node with MongoDB to Spring Boot with MySQL. But every once in a while it's great go back to the hows and whys of Java. 👏👏👏
ОтветитьThank you for this video
Ответитьthanks for making such an awesome lecture. hoping for more such tutorials
ОтветитьYou explained the difference real well, but I find the advice unusual
Use what is most suitable for the task, not "ArrayList because it is more capable"
thank you so much ! great content (including the joke at the end haha)
ОтветитьYou are really superman.. Because your video helpful to everyone... I saw a video from tamilnadu in south India....... Your are my best teacher
Ответитьperfect!
Ответитьsomebody pls let me know if there is a complete collection framework available by our beloved jhon
ОтветитьNeed justice for chris 😢
ОтветитьAmazing video, thank you so much.
ОтветитьHaving spent a semester learning and working with C (and now learning Java in my CS classes), I have to say that the dynamic size of array lists sure does have me excited :D
ОтветитьDo you have content that goes through how Java resizes ArrayLists? how about the space and time complexity of the inserts and deletes?
ОтветитьDo you have any content talking about the performance implications of Unboxing and Autoboxing data types in Collections? In this video you seem to quite casually suggest using Object type wrapper for primitive classes but i've found under some situations there's a performance hit with using those instead of the primitive types?
ОтветитьGreat vid!
ОтветитьJohnny Sins is really a great java teacher
ОтветитьJust like Python has a Sentdex, Java has a John 💞💞 You guys are awesome!
ОтветитьAwesome way of teaching John.. please don't stop teaching at any cost. This really helps a lot of people !! you deserve more subscribers
Ответить