c# (Csharp) and .NET :- Difference between IEnumerable and IEnumerator.
HTML-код
- Опубликовано: 30 мар 2012
- For more such videos visit www.questpond.com
For more such videos subscribe ruclips.net/user/questpondvide...
See our other Step by Step video series below :-
Learn C# Step by Step goo.gl/FNlqn3
Learn Design Pattern Step by Step:- goo.gl/eJdn0m
Learn Angular tutorial step by step tinyurl.com/ycd9j895
Learn MVC Core step by step :- tinyurl.com/y9jt3wkv
Learn Azure Step by Step :- tinyurl.com/y6fmrech
Learn SharePoint Step by Step in 8 hours:- goo.gl/XQKHeP
Python Tutorial for Beginners:- • Python Tutorial for Be...
Learn Data Science in 1 hour :- tinyurl.com/y5o7qbau
Learn Power BI Step by Step:- tinyurl.com/y6thhkxw
Learn MSBI Step by Step in 32 hours:- goo.gl/TTpFZN
Learn SQL Server Step by Step tinyurl.com/ja4zmwu
Learn Tableau step by step :- tinyurl.com/kh6ojyo
In this c# video video we will try to understand in what scenarios we should use IEnumerable and what scenarios we should use IEnumerator.
We are also distributing a 100 page Ebook ".NET Interview Questions ". If you want this ebook please share this video in your facebook/twitter/linkedin account and email us on questpond@questpond.com with the shared link and we will email you the PDF.
Do not miss our Interview Question video series
30 Important C# Interview Questions : ruclips.net/video/BKynEBPqiIM/видео.html
25 Important ASP.NET Interview Questions : ruclips.net/video/pXmMdmJUC0g/видео.html
25 Angular Interview Questions : ruclips.net/video/-jeoyDJDsSM/видео.html
5 MSBI Interview Questions : ruclips.net/video/5E815aXAwYQ/видео.html
This question has been going around for years and finally someone who just answered it in a very in-depth yet simple way. Thanks from Master Zhu! :)
Very well explained in simplistic words.
This truely signifies the role of a good teacher.
Shiv sir you are the best !!! Keep it up...
I think the more accurate syntax for the difference between IEnumerable and IEnumerator is that: it is not the IEnumerable or IEnumerator maintains the state or not, but the technique of iteration through IEnumerable or IEnumerator rests the position or not.
As you loop through IEnumerable with foreach loop, the foreach loop automatically resets the IEnumerable position to the initial position each time you iterate.
While as you iterate through IEnumerator with MoveNext() method the position is maintained
with the new iteration loop, because nothing automatically changes the position of IEnumerator and if you want the initial position of IEnumerator you must use Reset() method.
So, the technique used to iterate through IEnumerable rests the position automatically
each time you iterate, while The technique used to iterate through IEnumerator begins the iteration from the last IEnumerator position and no automatic reset is carried out in IEnumerator iteration.
thank you for this concept.
You are a life saver. Finally, I get the difference between these two now.
I was very confused between IEnumerable and IEnumerator before the video, I had a very clear explanations from your videos in depth.Thank You.
Thanks for making this much clearer. I appreciate your time.
I had these exact questions and you have answered really well with simple and clear explanation. Thank you!
i love your explanation! thank you so much! you saved me!
Simple and clear explained. Thank You!
good entertaining explanations- I use it for looping through controls in forms apps but I didn't know what differences between the two were
Well done. No words to appreciate. Long time confusion is cleared..
Love these videos. Very comprehensive explanations.
Thanks sir ji.
Loved the way u have explained it.
Thank you! That’s a valuable information.
You always give excellent examples and analogy, thanks a lot for sharing
Thanks I have been looking for a decent explanation of the difference between the two collections.
Thank you very much now I got very clear idea about these two interfaces thanks once again
Great video... Would just like to point out one thing... Maybe no one noticed it but at 12:25, you say "The Biggest difference between IEnumerable and IEnumerator is that IEnumerable REMEMBERS STATES while IEnumerable DOES NOT."
I think you wanted to say "IEnumerator remembers states while IEnumerable does not" Obviously that was an accident. But just wanted to point out. Thank you so much for the help!
Thanks, you made the Difference clear!
Clear and concise explanation.. Awesome..
Excellent explanation of the difference between the two. Thanks.
The video was awesome...i was finding it difficult to understand the difference from many sites, this video was crisp and clear...kudos
Also at 10: 16 we should pass int i in the IEnumerable example to 2nd function Iterate2001andAbove() instead of passing o (which is the full list). This will fix listing the years multiple times... :-)
Hope that helps.. Thank you once again!
Was going to comment the same
You are a true professional and an excellent explanation
Thanks ! Very clear explanation.
Cleared a very important concept. Thanks a lot.
Great explanation ...u reduced my stresssss..
Perfect explanation. Thank you
Better than most other explanations!
now i can die in peace
RIP in peace.
:D
This made me laugh so hard. But its so true. Programming can get so confusing at times
LOL :D
:p
Very good video. As always, well explained, easy to follow code and example. Thanks for sharing with the world.
Very good explaination, thank you ! Now I understand :D
i dont know why some stupid people are disliking these videos. this guy has great way of teaching and he is doing it for free and on the other hand he is very well experienced and sharing his experience
You cleared up a lot for me, thank you
thankyou sir, nicely demonstrated :)
Very nice explanation. Thanks for the video.
it really help me to understand basic difference, Thanks,
Maaaaan, THIS IS A TUTORIAL!!! Amaaaxxxxing :D
Thank your clear explation sir thumbs up from PH🇵🇭
This is nice, I learned it,
Thank you sir !
Thanks a lot Sir for explaining very well.
Really helpful video....Thanks a ton.
Very good explanation, Thank you.....
Very good explanation. Thank you dude !
!Very clear explanation, thanks
Wow, very good! Would you do a video on the ICollection interface, the IList interface and the IDictionary interface?
You explaine very well peace
great work man. hardworking and talented people like you deserve subscribers and appreciation rather than those loser tiktokers.
i love your explanation! thank you so much! you saved me too ... :)
Good explanation. Thanks!!!
Thanks for the explanation however, IEnumerator seems similar to Yield since both maintain state iteration state.
What could be the possible difference between them and in what scenarios we should specifically use them?
Thanks in advance
Great Example..thanks alot..
Thank you. In short, IEnumerable is the collection itself that can be iterated.
IEnumerator is an enumerator object that's used to iterate through a collection of data.
So for a collection to be enumerable it must provide an enumerator object. IEnumerable exposes the GetEnumerator method that provides that enumerator.
u r superb sir.. Keep helping us
Excellent explanation sir ...Thank you 🙏
Very nice and clear explanation... Thanks a lot
Now that I understood what I need to.... I am all set for Nirvana - Guru ji with your blessings.
That example very good. Thanks.
Tanks for this show. I learned a lot with video.
Amazing example. Thanks
Great video and thanks a lot!
Thank you for this very clear explanation
Nice explanation...Thanks alot sir...
Thalaivaaa. You are great !!!
Amazing! Thanks.
Thank you very much!
Very good Explanation for Enumerator and Enumerable
Very good explanation, thank you.
Wow Sir Awesome ! Nicely explained loved it 😊😊
Great explanation!
Its already uploaded. we would like to clarify to everyone here what videos we upload on youtube are a very very small part what we have on questpondvd.
Super shiv sir thanks for making my learning easy. I got one doubt to make the ienumerable remember cursor position can we use getenumerator()?
your second example made me clear
man you are really good...
excellent lecture clear view
If foreach is the case and we're not interested in current position then why should we choose IEnumerable too instead of we might have use object of List in foreach right and why we go for IEnumerable? can you please anyone clear my doubt, Thank you.
Great Good! explanations Thank you
Best example I have seen,it's registered in my mind.
short and sweet :) tks
Great tutorial.
Thank you sir.
Nicely explained... :)
Nice video..thanks!
Nicely explained.
Nice! Thanks a lot!
Decent Explanation.
Thanks a lots keep posting for us please 🙏👍 ☺️
Really nice video!! you have mentioned that IEnumeratble internally uses IEnumerator, so why it does not remember the current cursor position?
This cleared things up for me. Thank you very much!
good video. Thanks
10/10 would watch again
A nice one. am just bit confused why did you need an explicit casting while creating the IEnumerable?The list was anyway of int right???
It's not about int, it's about IEnumerable. Because List implements more interfaces, not only IEnumerable and generally has more features. So when you store the reference of list in IEnumerable you won't have access to all List features, just the features IEnumerable implements. You got to cast it explicitly because you limit it functionality.
By limiting the functionality, does it have any benefit, like in terms of time and memory?
nice exemple.thanks
Super explanation bro..
Good job!
thank you
Well you got yourself a subscriber your video was very informational and much appreciated :P
Very nice...Thanks
thnku sir. it was very helpful.
neat and good example