Byte Pint
Byte Pint
  • 25
  • 47 590
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]
Переглядів: 189

Відео

BigDecimal might lie 😳
Переглядів 30321 день тому
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
Переглядів 96828 днів тому
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
Переглядів 44 тис.Місяць тому
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
Переглядів 82Місяць тому
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
Переглядів 442 місяці тому
Exploring Collectors - groupingBy, mapping, and counting Functions
Understanding the Importance of Collectors in Java Streams | Implementing Custom Collector
Переглядів 552 місяці тому
Understanding the Importance of Collectors in Java Streams | Implementing Custom Collector
Java Stream Collectors | toList, toSet, toCollection, joining
Переглядів 362 місяці тому
Java Stream Collectors | toList, toSet, toCollection, joining
Mastering Java Streams with java.util.stream.Collectors API | Java Tutorial
Переглядів 482 місяці тому
Mastering Java Streams with java.util.stream.Collectors API | Java Tutorial

КОМЕНТАРІ

  • @warmachineuk
    @warmachineuk 6 днів тому

    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 9 днів тому

    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 14 днів тому

    Object types store memory addresses, not values.

  • @shivaji011
    @shivaji011 16 днів тому

    Nice content, keep up the good work 🛐🛐

  • @Golfer-xx8vd
    @Golfer-xx8vd 17 днів тому

    keep them coming.. nice content

  • @21k60
    @21k60 17 днів тому

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

  • @frommarkham424
    @frommarkham424 17 днів тому

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

  • @ObadiahHoss
    @ObadiahHoss 19 днів тому

    Great video

  • @sebastiantomczyk4577
    @sebastiantomczyk4577 20 днів тому

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

  • @panda4247
    @panda4247 21 день тому

    another reason why Java is one of the most retarded languages

  • @WackoMcGoose
    @WackoMcGoose 22 дні тому

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

  • @casperhansen826
    @casperhansen826 22 дні тому

    Avoiding Java at all cost

  • @drdca8263
    @drdca8263 22 дні тому

    [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 22 дні тому

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

  • @SugarBeetMC
    @SugarBeetMC 22 дні тому

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

  • @StrangerNoises
    @StrangerNoises 22 дні тому

    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 22 дні тому

    tldr: Java is broken

  • @ross9263
    @ross9263 23 дні тому

    Hey this is a great video, make more!

  • @EatSleepCodeRepeat_
    @EatSleepCodeRepeat_ 24 дні тому

    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 24 дні тому

    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 24 дні тому

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

  • @The16MHz
    @The16MHz 24 дні тому

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

  • @yootoobvyooer
    @yootoobvyooer 24 дні тому

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

  • @hikari1690
    @hikari1690 24 дні тому

    My brain is overloading

  • @andiback
    @andiback 24 дні тому

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

  • @baxstart9008
    @baxstart9008 24 дні тому

    so it almost acts like a 7 bit integer 💀

  • @plaidchuck
    @plaidchuck 24 дні тому

    == 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 24 дні тому

    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 25 днів тому

    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 24 дні тому

      Yet it doesn’t automatically cast floats 😂

    • @CorneliusCornbread
      @CorneliusCornbread 24 дні тому

      @@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 25 днів тому

    Having implementation details affect the result is horrible design.

  • @camilocamargo3596
    @camilocamargo3596 25 днів тому

    Wow, super cool video.

  • @zr0724
    @zr0724 26 днів тому

    nice explanation

  • @enitalp
    @enitalp 26 днів тому

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

  • @AK-vx4dy
    @AK-vx4dy 26 днів тому

    And people go crazy about JS ;)

  • @navneethgopal1211
    @navneethgopal1211 26 днів тому

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

  • @rasskhovp528
    @rasskhovp528 26 днів тому

    Wonderful

  • @asandax6
    @asandax6 26 днів тому

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

  • @rock64573
    @rock64573 26 днів тому

    For those wondering why you would need to use wrapper classes for primitive types: 1. Only `Object` types can be modified when passed as an argument to a method. 2. `Object` types can have null value. 3. Generic types only allow `Object` types. 4. Can call multiple methods, like `compareTo()`, `equals()`, `toString()`, etc. 5. Cloning and serialization are only supported for `Object` types. 6. Objects are needed to support synchronization in multithreading.

  • @farpurple
    @farpurple 26 днів тому

    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 27 днів тому

    What a retarded design

  • @leshommesdupilly
    @leshommesdupilly 27 днів тому

    Because Java isn´t a serious programming language

  • @zr0724
    @zr0724 27 днів тому

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

    • @bytepint
      @bytepint 27 днів тому

      Thank you! Sure 👍

  • @UnwittingSweater
    @UnwittingSweater 27 днів тому

    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 27 днів тому

    Thx

  • @RadenVijaya
    @RadenVijaya 27 днів тому

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

  • @billclinton4913
    @billclinton4913 27 днів тому

    that's mad silly.

  • @mementomori7160
    @mementomori7160 27 днів тому

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

    • @yootoobvyooer
      @yootoobvyooer 24 дні тому

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

  • @efekos
    @efekos 27 днів тому

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

  • @tetrabromobisphenol
    @tetrabromobisphenol 27 днів тому

    I knew there was a reason I never bothered to learn Java. YUCK. I hope Scala isn't repeating this same type of nonsense.