Interesting! Although I'd have never found a use for it (yet)
@bienadam37 минут бұрын
...it is the beginning of a NoSQL store 😀
@thecodealchemist709514 сағат бұрын
Java 23?
@bienadam38 минут бұрын
....Java 6 (docs.oracle.com/en/java/javase/23/docs/api/java.base/java/util/NavigableMap.html) 😀 Thanks for watching!
@unus5515 сағат бұрын
Wonderful data structure
@bienadam14 сағат бұрын
Indeed! ...and there was only time to show two methods. headMap(), tailMap(), higherKey(), lowerKey() are equally useful. Thanks for watching!
@unus5514 сағат бұрын
@@bienadamthanks
@pmorah16 сағат бұрын
Interesting 😊
@bienadam14 сағат бұрын
Thanks for watching!
@zickzack98718 сағат бұрын
Extremely bad audio
@spacey69602 күн бұрын
Performance difference next pls
@bienadamКүн бұрын
...we would need more data to compare performance. LLM inference such as kzbin.info/www/bejne/lZOqnWWEatiIp7c would hardly be possible without the Vector API. Thanks for the suggestion!
@foobartuba2 күн бұрын
Wow!
@F38U2 күн бұрын
L == "l", java is such a joke
@menn4h3 күн бұрын
Hi Adam, do you have a keystore with your public key certificate in your payara server here? I can't get microprofile jwt to work without the keystore even though the public key is defined in microprofile-config.properties
@slartidan4 күн бұрын
Thanks for mentioning JMH 🙂
@unus554 күн бұрын
Oh nice
@Test-ye2ds4 күн бұрын
Hi, thanks for the video. HashMap also has a constructor that allows setting the initial capacity. What's the difference?
@jwmeyling4 күн бұрын
That capacity of the HashMap is not equal to the expected size, one needs to consider the load factor as well. Capacity is the number of buckets in the map, not the number of entries. This confusion is now eliminated using the new utility method.
@Muescha5 күн бұрын
char == 'l' is fine here, but be cautious of a common pitfall: if it’s a string, you need to use .equals.
@ghadifreiha98835 күн бұрын
A much better method I'd argue is to call Collectors.groupingBy(...) and then just call the map.get("l").size()
@alfagroupkz5 күн бұрын
I just didn't get it. Why the hell l == 'l' do what we expect?
@kilianbalter5 күн бұрын
The naming is a bit confusing maybe. I feel c -> c == 'l' would be better. The c in this case is just the individual characters coming from the char stream. Then we check if they're equal to the character l. The filter function then only lets all the l's through and they're counted.
@bienadam4 күн бұрын
The naming is confusing. When I was recording, I thought "l" was a good name to search for the actual "l" character. In a project, I would call it "character" or "current". Thank you all for your feedback and comments!
@mbkhan10007 күн бұрын
I remember reading your EJB book back in the day! Good to see your fearless support ❤
@piyushkapoor87317 күн бұрын
very easily explained
@ashutosmisraa7 күн бұрын
Superb
@anjunarathod52367 күн бұрын
sir plz how to set up bytecode in environment system
@leccio8 күн бұрын
A kufiya, for real? Don't be woke, Reza!
@lucianodegni91519 күн бұрын
thanks for this trick 👍
@kenduraghav9 күн бұрын
Is it better to use get method ? If I have value to be present and need to use it next places
@unus559 күн бұрын
Vibrant :)
@tahatahereddine11 күн бұрын
Why do you use "var" instead of the type of the object. is it better for some reason I don’t know yet, i don't get it 🤔.
@lukawagner724211 күн бұрын
Whst is this Methode chaining called in Java?
@goodstuffsonly254511 күн бұрын
Is it batter to use fallback for null safety than orelse ?
@bienadam9 күн бұрын
The orElseGet method calls the fallback only when needed. orElse eagerly calls the fallback and "caches" the value to use when needed. This can be critical for expensive operations such as calling external systems. Sometimes you may want to get a "fresh" value if it is not available. Then you need to use the orElseGet method. Thanks for your comment!
@LuisCardozoC12 күн бұрын
How would an endless stream be? Will it ever start processing? (As we need terminal operators)
@metabrix12 күн бұрын
It will as soon as the first element is generated, since streams are pipelines operating on each element, not on all elements by steps
@bruhboing334912 күн бұрын
Are you addicted to random? Also shorts can last 3 minutes instead of 1 now
@kennedymbogo54213 күн бұрын
What is a seed?
@azekilldiablo931512 күн бұрын
A number used by the Random function to create the "Random" sequence. Think of a number you input in a mathematical function!
@MyzticBean7 күн бұрын
@azekilldiablo9315 if we don’t give any seed, he said java will choose a random seed. What seed does it use to do that then? 🤔
@azekilldiablo93157 күн бұрын
@@MyzticBean I have no idea, you would have to look that up in details. My guess is it's using some java library to generate that one seed number (with a fixed seed someone chose at some point, some long string of number).
@Beesman882 күн бұрын
@@MyzticBean most pseudorandom generators use time as seed or part of seed. That's why if you loop and gen random numbers fast - .next will work as expected. But creating new instance of random in your loop will very often give you same numbers in a row - because multiple instances used the same seed, because it goes from time.
@pizzamon499013 күн бұрын
(int)Math.random()*11;
@khalilelemam134914 күн бұрын
Before i saw someone using secureRandom class or something like that for generating random numbers(to generate a verification code for email verification ) is it different from using Random class...i know that they use different algorithms but what do they mean by more secure ?😅
@bienadam13 күн бұрын
A very good question. I'm already thinking about whether it's possible to answer it with another short. I will cover your comment in the next airhacks.tv! Thank you very much!
@bienadam13 күн бұрын
Your comment was "airhacked": gist.github.com/AdamBien/355fd0bebcfd5865464cbaf32b0e3e5a?permalink_comment_id=5315955#gistcomment-5315955
What about List or Map? If I want convert List or map from yml properties.
@hugohabicht627418 күн бұрын
What's the advantage of this? Env vars are mapped into the process memory at process creation, so accessing them is simply reading a bit of memory of the process, I don't get how copying them is useful...
@bienadam18 күн бұрын
System.getenv is just one example of a configuration. We could read a configuration from a file instead, which would make more sense in this context. But even with environment variables, the implementation depends on the chosen strategy: fail fast vs. eager loading. Thanks for the comment!
@hugohabicht627418 күн бұрын
@@bienadam that's a good point, I didn't consider that. Thanks for the answer and all your content!
@bienadam18 күн бұрын
Please keep asking - I like feedback.😀
@MovinduLochanaWijethunge18 күн бұрын
Hey, can you start a tutorial guide on Quarks
@bienadam18 күн бұрын
You mean Quarkus? Like that: kzbin.info/www/bejne/lXmrameEd85ko6ssi=LXeXvDzZBG8d--Kl ? 😀
@MovinduLochanaWijethunge18 күн бұрын
@@bienadam Thanks 😎
@runcygeorge-mi5no19 күн бұрын
How out.println works without import java.lang.System.out;
@bienadam19 күн бұрын
This is one of the FAQs, therefore 👉: kzbin.infoKbyZVo0vuKY 😀 Thanks for watching and asking!
@ferjava19 күн бұрын
Looks good! You can also pre-process other potential static values just once by initializing them through an enum constructor =)
@bienadam19 күн бұрын
Yes - this is a good idea for an upcoming short. However: it depends whether the value is available at build time or can change at runtime. Thanks for the comment!
@bsdooby19 күн бұрын
now we are talking 😅
@syrymzhakypbekov194920 күн бұрын
What a java champion ???
@syrymzhakypbekov194920 күн бұрын
XD terminal man
@StefanSiegl2320 күн бұрын
shouldn't it be `new Random().nextInt(10) + 1` then? nextInt may return zero (inclusive) ... your first invocation in the video even returns 0
@satyarthtiwari775020 күн бұрын
Damn = Adam , u can drop the craziest Java full course on yt. Thanks for all the intutions buddy!
@bienadam19 күн бұрын
A good idea. I think I have recorded about 700 shorts already. If I sort them and then splice them together we'll have the craziest 13 hour Java course on youtube 😀 Thanks for watching! I like comments like that!
@unus5520 күн бұрын
Yh, Easy and clean I saw SecureRandom for generating OTP.
@skr-kute167720 күн бұрын
How do you have access directly to out?
@filipenevespinto266520 күн бұрын
Static import?
@skr-kute167719 күн бұрын
@filipenevespinto2665 oh yeah true. Thank you
@michimarz21 күн бұрын
Well deserved. Thank you for your work.
@bienadam21 күн бұрын
Thank you for watching and subscribing! Shorts are fun!
@hugohabicht627421 күн бұрын
I've learned so much about modern Java from you, glad you make videos!
@bienadam20 күн бұрын
Glad to hear it! But also be careful. Some shorts are just an idea or a curiosity. ...and it is hardly possible to explain best practices in 1min. Thanks for watching!
@unus5521 күн бұрын
:)
@bienadam21 күн бұрын
... it is not so easy to say "thank you" with Java 21+ 😀
@jamaly8721 күн бұрын
Thanks Adam for your contributions. I subscribed today and I am here from your podcast. Cheers 🍻
@bienadam21 күн бұрын
Thank you for subscribing! Now I have to start preparing for the 40k message 😀
@mehrzweck_mandala22 күн бұрын
Thanks for this great content.
@bienadam18 күн бұрын
Thanks for listening and thank you for the nice feedback!