Java Fundamentals

Wrapping Up

Angie Jones

Angie Jones

Java Champion
Java Fundamentals

Check out a free preview of the full Java Fundamentals course

The "Wrapping Up" Lesson is part of the full, Java Fundamentals course featured in this preview video. Here's what you'd learn in this lesson:

Angie wraps up the course by answering student questions regarding resources for finding bugs and if there is a preference for where the print statement is located in a stream.

Preview
Close

Transcript from the "Wrapping Up" Lesson

[00:00:00]
>> Okay folks, that is all of the material that we needed to go through. Any questions about any topics?
>> Do you have any? Yes, what I'm thinking in terms of conceptions, exceptions and exception handling. I'm thinking about it in the terms of, especially, of potentially catching bugs.

[00:00:20]
Do you have any tips or resources you'd recommend for the process of finding and squashing bugs, I suppose, bug handling?
>> [LAUGH] Not with exceptions. So, I have a lot of material. If you go to my website, I have a ton of stuff on just automated testing, in general.

[00:00:48]
So there's a lot of resources there on just finding bugs. How to think about writing your code. How to write automated tests so that you do catch bugs and stuff that. But not specific to exceptions. Yes?
>> I have a question about streams.
>> Yeah?
>> Is there a preference for when to have the print statement separately versus inside the foreach statement?

[00:01:16]
Is there a difference of when to use which case?
>> Yeah, so within the foreach is when you wanna print every method, I mean, every element within the stream versus if you had it outside of the stream. You could print the entire collection if you want it as one versus inside of it.

[00:01:38]
And I don't wanna use print cuz it's a weak example. But there could be some processing you want done on each element of the stream, right? And in those cases is when you would use foreach on the stream itself. Outside of the stream, what you're working with is the actual collection.

[00:02:03]
So do you want to modify the collection or process the collection. Or do you just want this to be done on, the stream is essentially like a copy of that. You can do whatever processing you need. If you need it back in another form, you can get it back in a list, right?

[00:02:21]
So it's basically asking yourself, do I wanna actually modify the collection or do I just wanna do some processing but leave the original one intact? All right, folks, we can call it a class.
>> [APPLAUSE]

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now