It would be great to see a video on lambda expressions & it’s applications, multithreading and streams as well. Another great video 👍 looking forward to whatever you make next
@franciscoruivo96353 жыл бұрын
Thank you so much for your content, really appreciating the more in-depth look into some of Java's tools! The memes were fun too, keep experimenting on the formats you like! Would definitely love your take on functional Java!
@jack.hodkinson3 жыл бұрын
Thanks for the support Francisco, I appreciate it!
@TheBooban2 жыл бұрын
2:56 "If you know you got value, use optional...." - I thought the entire point was that I don't know?
@jack.hodkinson2 жыл бұрын
To create an Optional, for instance to return from a function, you either: a) have a String which is definitely not null: use Optional.of(theString) b) don't have a String at all: use Optional.empty() c) have a String which might be null: use Optional.ofNullable(theMaybeNullString)
@returncode00003 жыл бұрын
2:59 Yes, please 🙂
@scitechplusexplorer248410 ай бұрын
One more point should be taken care, NEVER pass Optional as a parameter to any method!!!!! It supposed to be used as return type.
@petergray4533 жыл бұрын
I knew it was a good idea to subscribe to your channel. Cheers.
@jack.hodkinson3 жыл бұрын
Thanks! I'm trying something a bit different out with this one, glad you enjoyed it!
@petergray4533 жыл бұрын
@@jack.hodkinson Yeah, and it's brilliant. YT is full of simplistic tutorials that don't really show you how a functions connect to other things to form a bigger picture. The previous vids were cool too. The YT algo doesn't favor those. I've heard they prefer daily content now (and corporate stuff, ugh). But keep pushing. Good luck!
@Eaton4763 жыл бұрын
Nice one, love the addition of memes 👌🏻
@jack.hodkinson3 жыл бұрын
Realised I couldn't live my life without them
@RajinderYadav2 жыл бұрын
This is not why Optional is needed to exist, it just passes the check down the line for null or empty. I hate when hip Java programmers force you to return optional from a function for impativite programming. The reason you need Optional is when working with functional programming and streams. There you can call methods on an Optional to do other things, that it's. If you're a bad programmer who doesn't check for null before working with a reference then no one can help you.
@greyshopleskin2315 Жыл бұрын
The problem with null is that it is a valid value for every reference. You cannot know if a value is nullable just from the type declaration. You can never be sure some variable is not null. So to be safe you would have to check all values, but it's overkill. So, from time to time, you don't handle the null case. Maybe your program is right today, but maybe tomorrow changes and you don't notice until it throws an exception in production. With optional, you must handle the null case, so it's impossible to have problems because of that. It does not matter if you use null or optional, you must handle null cases. The difference is, with null you could not handle it, and with optional you can be sure you did, otherwise it would not compile. This does not hold true for java, but in funtional languages, when you have a value which is not optional, the compiler ensures you it is not null. And that's awesome