Byte Pint
Byte Pint
  • Видео 25
  • Просмотров 49 662
Crazy edge cases in Java programming
Welcome to another episode of Java quirkiness. In this video I discuss about two more quirky behavior of Java which stumps even a seasoned Java developer.
Please hit the like button, share and subscribe.
[Java,software engineering,programming,computer science,Java projects,Java tutorial,coding,programming secrets,Java programming,software development,programming tricks,Java code tricks,coding tricks,Java development,Java tricks,Java tips,programming tips,Java secrets,Java hacks,python, javascript,equals and hash, ==, Integer, Integer.valueOf, comedy, programming memes, programming humour, Integer.MIN_VALUE, Double.MIN_VALUE]
Просмотров: 235

Видео

BigDecimal might lie 😳
Просмотров 3394 месяца назад
Ready for another mind-blowing weird behavior of Java? Discover why sometimes BigDecimal's equals method results true and sometimes false. BigDecimal is really big enough to handle Thanos level of numbers and floating points, but it has some weakness as well if not used properly. Packed with humor, easy-to-grasp analogies, and practical coding advice, this video is perfect for Java developers, ...
Crazy Method Overloading cases
Просмотров 1 тыс.4 месяца назад
Are you ready to test your Java skills with some tricky method overloading interview questions? In this video, I present a set of challenging Java interview questions that will stump 99% of viewers. Put your knowledge to the test and see if you can answer these questions correctly and if not? don't worry I have given correct answer as well as explanation for each. [Java,Java interview,Programmi...
Why Integer has this weird behaviour? | Java Interview Question
Просмотров 45 тыс.4 месяца назад
In this mind-blowing video, we dive into the fascinating world of Integer and uncover a surprising concept that will leave you in awe. Have you ever wondered why in case of Integer a = 2; Integer b = 2; a b evaluates to true, while Integer a = 200; Integer b = 200; results in false? Join us as we unravel this epic programming mystery and reveal the secrets behind this unexpected(or may be expec...
Git Flow in 100 Seconds
Просмотров 1404 месяца назад
In this quick 100-second tutorial, you will master Git Flow, a popular branching model for Git. Learn how to efficiently manage your project's workflow with feature branches, releases, and hotfixes. Stay tuned to become a Git Flow pro in just a minute and forty seconds! [git flow,git rebase,git stash,git workflow,github,git merge,git tutorial,git pull,programming,git branch,version control,codi...
Exploring Collectors - groupingBy, mapping, and counting Functions
Просмотров 466 месяцев назад
Exploring Collectors - groupingBy, mapping, and counting Functions
Understanding the Importance of Collectors in Java Streams | Implementing Custom Collector
Просмотров 916 месяцев назад
Understanding the Importance of Collectors in Java Streams | Implementing Custom Collector
Java Stream Collectors | toList, toSet, toCollection, joining
Просмотров 426 месяцев назад
Java Stream Collectors | toList, toSet, toCollection, joining
Mastering Java Streams with java.util.stream.Collectors API | Java Tutorial
Просмотров 536 месяцев назад
Mastering Java Streams with java.util.stream.Collectors API | Java Tutorial

Комментарии

  • @hikari1690
    @hikari1690 22 дня назад

    I'm not a granpa... I'm not even a father yet... Why you must insult me like that...

  • @Code_Machine
    @Code_Machine 26 дней назад

    What a great channel

  • @David_Raab
    @David_Raab Месяц назад

    I never have seen a language without such quirks, but i think this a serious crap quirk.

  • @warmachineuk
    @warmachineuk 3 месяца назад

    Don’t treat Integer objects like the primitive type. Use the primitive type in preference. Check for null if needed and get the primitive value for comparison.

  • @beldraith8051
    @beldraith8051 3 месяца назад

    Small Fun Fact: you can access the Integer Cache via Reflection. Just add a static Code block and rewrite the Cache with random numbers and enjoy the Autoboxing chaos unfold

  • @ncmathsadist
    @ncmathsadist 4 месяца назад

    Object types store memory addresses, not values.

  • @shivaji011
    @shivaji011 4 месяца назад

    Nice content, keep up the good work 🛐🛐

  • @Golfer-xx8vd
    @Golfer-xx8vd 4 месяца назад

    keep them coming.. nice content

  • @21k60
    @21k60 4 месяца назад

    Spent most hours in my college days. They never said this😂😂

  • @frommarkham424
    @frommarkham424 4 месяца назад

    TECHNOLOGY IS AWESOME🗣🗣🗣🗣💯💯💯💯🔥🔥🔥🔥

  • @ObadiahHoss
    @ObadiahHoss 4 месяца назад

    Great video

  • @sebastiantomczyk4577
    @sebastiantomczyk4577 4 месяца назад

    Integer myGirlFriends = -1; xD ...;(

  • @panda4247
    @panda4247 4 месяца назад

    another reason why Java is one of the most retarded languages

  • @WackoMcGoose
    @WackoMcGoose 4 месяца назад

    Okay, but... _why_ do you need an object version of a primitive data type, anyway?

  • @casperhansen826
    @casperhansen826 4 месяца назад

    Avoiding Java at all cost

  • @drdca8263
    @drdca8263 4 месяца назад

    [edit: dang, youtube interpreted the underscores as indicating italics. Does youtube support escaping characters? Apparently not quite.] Seems to me like Python has the right idea here: use “is” for checking if the lhs and the rhs are the same object, and use “==“ to do lhs.\_\_eq\_\_(rhs) (or rhs.__req__(lhs) if lhs has no __eq__ attribute, maybe. Idk if Python actually has a __req__ thing, as I believe Object has a default implementation of __eq__ , so it would only fail to exist if you removed it?). Or I guess your language could use “===“ in place of “is” if you prefer sigils to keywords. Having == check for identity for type Integer seems inconvenient without a good reason.. (other than possibly legacy code, I guessss…)

  • @jarekmyszko3332
    @jarekmyszko3332 4 месяца назад

    Always, always, always... use programming language that doesn't introduce such illogical behavior.

  • @SugarBeetMC
    @SugarBeetMC 4 месяца назад

    Why doesn't Integer implement __eq__() to override ==? ... oh.

  • @StrangerNoises
    @StrangerNoises 4 месяца назад

    i know why. (without watching.) Autoboxing and Integer.valueOf(n) will return a cached Integer instance for values -1 to 100 (IIRC), so those Integer objects are the same instance. For 900, it's a fresh Integer instance each time. You're using reference equality rather than Integer::equals so it's returning whether it's the same instance, regardless of value.

  • @stulora3172
    @stulora3172 4 месяца назад

    tldr: Java is broken

  • @ross9263
    @ross9263 4 месяца назад

    Hey this is a great video, make more!

  • @EatSleepCodeRepeat_
    @EatSleepCodeRepeat_ 4 месяца назад

    That's why C++ is still one of the most reliable languages out there. C++ offers full control over a lot of things including cache. I chose C++ because it's the only language I know. 😅 There are surely more than one language offering this much freedom.

  • @deltics735
    @deltics735 4 месяца назад

    This shouldn’t be an interview question, it should be a question for the C-Suite of any company that thinks it’s a good idea to build critical systems using Java.

  • @Ribula1
    @Ribula1 4 месяца назад

    Ok so, int does not stand for interger... What is int then?

  • @The16MHz
    @The16MHz 4 месяца назад

    Integer in Java is a Class. Next Vídeo.

  • @yootoobvyooer
    @yootoobvyooer 4 месяца назад

    Only reason I use java is android studio and majority of help on internet are in java.

  • @hikari1690
    @hikari1690 4 месяца назад

    My brain is overloading

  • @andiback
    @andiback 4 месяца назад

    😀 at 0:36 this is German TV actor Walther Hoffmann performing in popular wedding soap

  • @baxstart9008
    @baxstart9008 4 месяца назад

    so it almost acts like a 7 bit integer 💀

  • @plaidchuck
    @plaidchuck 4 месяца назад

    == checks for the same address, equals checks the actual object state or value. It’s not that hard idiots. You can even override equals to do whatever your lame javascript franework using ass desires

  • @CKidder80
    @CKidder80 4 месяца назад

    Java seems cursed. I already didn't like it and refuse to use it because it has no concept of unsigned integers (ICK!) but this is even worse. James Gosling should have been slapped with a trout when he was designing this cancer of a language.

  • @CorneliusCornbread
    @CorneliusCornbread 4 месяца назад

    Me when I use C# and don't need to use a wrapper class for primitives because generics support the usage of primitives.

    • @plaidchuck
      @plaidchuck 4 месяца назад

      Yet it doesn’t automatically cast floats 😂

    • @CorneliusCornbread
      @CorneliusCornbread 4 месяца назад

      @@plaidchuck floats will be implicitly casted to doubles but not vice versa, as such a cast is lossy. Why you would want implicit, destructive casting is beyond me Also neither does Java, frankly I'm not sure what you're talking about here

  • @DreanPetruza
    @DreanPetruza 4 месяца назад

    Having implementation details affect the result is horrible design.

  • @camilocamargo3596
    @camilocamargo3596 4 месяца назад

    Wow, super cool video.

  • @zr0724
    @zr0724 4 месяца назад

    nice explanation

  • @enitalp
    @enitalp 4 месяца назад

    The same as LUA, you need to know how the VM works to program it. That's stupid.

  • @AK-vx4dy
    @AK-vx4dy 4 месяца назад

    And people go crazy about JS ;)

  • @navneethgopal1211
    @navneethgopal1211 4 месяца назад

    Does this occur in C# as well? Cause' they are very similar languages.

  • @rasskhovp528
    @rasskhovp528 4 месяца назад

    Wonderful

  • @asandax6
    @asandax6 4 месяца назад

    Javascript: Perhaps we are related (==,===)

  • @farpurple
    @farpurple 4 месяца назад

    The fffff okay i saw such in python but there is with "is" statement, Java absolutely weird on this, tf i should care, am i not comparing values?? Who tf even made Integer class and why?? Use freaking int, wtf is Integer ahha??

  • @Cyrus_II
    @Cyrus_II 4 месяца назад

    What a retarded design

  • @leshommesdupilly
    @leshommesdupilly 4 месяца назад

    Because Java isn´t a serious programming language

  • @zr0724
    @zr0724 4 месяца назад

    We often miss details when learning a language; these videos fill that gap. please do upload more videos like these :)

    • @bytepint
      @bytepint 4 месяца назад

      Thank you! Sure 👍

  • @UnwittingSweater
    @UnwittingSweater 4 месяца назад

    That's interesting but if i got that as an interview question i would leave the interview. A good reason why to use .equals through. But then just have that as a rule in your code pipeline so your team all have the same level of best practises.

  • @Pawlo370
    @Pawlo370 4 месяца назад

    Thx

  • @RadenVijaya
    @RadenVijaya 4 месяца назад

    This is the stupid of Java side 😂 and it's inherited on Kotlin too 😂

  • @billclinton4913
    @billclinton4913 4 месяца назад

    that's mad silly.

  • @mementomori7160
    @mementomori7160 4 месяца назад

    Never touched java before, I've learned from this vid that I'm not gonna touch it ever

    • @yootoobvyooer
      @yootoobvyooer 4 месяца назад

      Try it with C++ class, not int primitive.

  • @efekos
    @efekos 4 месяца назад

    why would you use Integer instead of int in the first place