Java Comparable interface with funny animation

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ม.ค. 2025

ความคิดเห็น • 75

  • @BlueFlow
    @BlueFlow 8 ปีที่แล้ว +19

    I've been a Java Developer for about 5 years now. I wish I had someone like you explaining basic things like this. +1

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว +2

      Thanks.I even think you should still be able to learn something from my videos, especially in my earlier videos I give a lot of clean code advice at the side.

  • @AvikNayak_
    @AvikNayak_ 2 ปีที่แล้ว +1

    I have seen a lot of other educators who teach really well but no one could teach this topic as well as you. It was simply too good!

  • @TheAksont
    @TheAksont 4 ปีที่แล้ว +3

    Thank you for this! Maybe the only video on this subject here on TH-cam that is actually helpful for beginners!

  • @RedEyedJedi
    @RedEyedJedi 7 ปีที่แล้ว +4

    "Duplicate code is evil" hahaha. I love that bit. So happy I found your channel, it's really helping me a lot.

    • @MarcusBiel
      @MarcusBiel  5 ปีที่แล้ว

      You're welcome :)

  • @j_thom
    @j_thom 6 ปีที่แล้ว +1

    Teaching style is simply amazing! Where's your Nobel Peace prize?

    • @MarcusBiel
      @MarcusBiel  6 ปีที่แล้ว +1

      LOL. Are you making fun of me? :)

  • @manikanta-sr3zc
    @manikanta-sr3zc 5 ปีที่แล้ว +2

    Sir very thanks you have explained to us in the best manner and in animation even non developer can also understand very easily

  • @prakashbawge3688
    @prakashbawge3688 4 ปีที่แล้ว +2

    Too good sir ,I have never seen like this type of teaching skills,will give suggestion to my son also to follow u

  • @JMTorresDupri
    @JMTorresDupri 8 ปีที่แล้ว +2

    Marcus. I really appreciate this explanation. Was perfect for me. The best for you.

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      Thanks! Your welcome! :)

  • @alexsora624
    @alexsora624 3 ปีที่แล้ว

    you're a god
    helped me out with my university assignment

  • @Genesyxx
    @Genesyxx 5 ปีที่แล้ว +1

    a very clear and concise tutorial. great job!

  • @rachanabennur9457
    @rachanabennur9457 3 ปีที่แล้ว

    That was such a clean and clear explanation! thank you so much!

  • @MR2SpyerJournal
    @MR2SpyerJournal 7 ปีที่แล้ว +1

    You know, using illustrations like you do is great! Very helpful. I wish Java Docs were as useful as your video. haha

  • @tarajano1980
    @tarajano1980 7 ปีที่แล้ว +2

    "Initially you dont create clean code" ... oh boy ! that was a big relieve for me and my sanity :-D

    • @MarcusBiel
      @MarcusBiel  7 ปีที่แล้ว +2

      :) Your welcome. I thought this is important to mention. The majority of developers "call it a day" and go home once their code compiles. But this is only when the REAL work actually STARTS - making your code clean is step two AFTER the code does what it is supposed to do. Work in little baby steps. Making it WORKS SOMEHOW is already a big, FIRST stept. It's like writing a book - you don't write a bestseller in a day ...

    • @JerreMuesli
      @JerreMuesli 3 ปีที่แล้ว

      Red, Green, Refactor!

  • @moha_kunX
    @moha_kunX ปีที่แล้ว

    bro really made java funny lol

  • @sfundoy5dube59
    @sfundoy5dube59 2 ปีที่แล้ว

    Well explained, much appreciated sir🙏✨

  • @habibbenmammar2203
    @habibbenmammar2203 8 ปีที่แล้ว +1

    thanks marcus, it was clear and clean

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      +Goldorak DZ perfect :)

  • @xskieojokoja3703
    @xskieojokoja3703 8 ปีที่แล้ว

    4:06 "Objects of type Apple can be compared to other Apple objects" - does this mean that I can compare a class name Apple with other class named Guava if I write "class Apple implements Comparable" ?

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      Is that a rhetorical question? If not, just try it out by yourself, this will help you way more then me telling you.

  • @alphanelmas1662
    @alphanelmas1662 5 ปีที่แล้ว +1

    Clear explanation thanks sir

  • @singh_1057
    @singh_1057 ปีที่แล้ว

    Nice explanation 🙏

  • @longkesh1971
    @longkesh1971 ปีที่แล้ว

    Thank you for making this video.

  • @jlestua
    @jlestua 8 ปีที่แล้ว +1

    thanks Marcus for the explanation!

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      Your welcome! Let me know if I can help you with anything.

  • @Djaoverpower
    @Djaoverpower 3 ปีที่แล้ว

    wouldn't it work even if we don't wright "comparable " in the Apple class creation ??

  • @mackensonreginaldmichel399
    @mackensonreginaldmichel399 4 ปีที่แล้ว

    Thanks for the viodeo. I have a problem. sometimes I see that people put .... implements . Why they do that? why you do something different?

  • @dilipjain9581
    @dilipjain9581 8 ปีที่แล้ว +2

    you are explain too good.

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      +Dilip Jain Thanks Dilip! :)

  • @chanpheakdeychum1516
    @chanpheakdeychum1516 6 ปีที่แล้ว

    Can you explain what this.weight means? at 5:40s when overriding compareTo.

    • @MarcusBiel
      @MarcusBiel  6 ปีที่แล้ว

      Sure. "this." refers to the current instance. it is necessary if you have a local variable as well as global instance variable, and you want to differentiate between the two this.myVariable will reference to the global variable of the current instance, and "myVariable" in this case would refer to the local variable. In the given case, "this" is only used to make the code nicer readable - I used "other" to refer to the other apple instance, and "this" to refer to the current instance - this way we can easily compare the two :)

  • @saadmanahmed860
    @saadmanahmed860 5 ปีที่แล้ว +1

    good illustration..

  • @stevie_efbabyy
    @stevie_efbabyy 8 ปีที่แล้ว

    @5:38, it seems as if either one of the if statements were true, it would return that number and still return 1. How is that correct?

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      ? If one of the statements is true, it will return -1 (in the first case) or 0 in the other and leave the function. 1 will be returned if none of the if cases apply. Why don't you try this out by yourself, with some small example, to get a deeper understanding?

    • @stevie_efbabyy
      @stevie_efbabyy 8 ปีที่แล้ว +1

      Oh i get it cause theres a return value in each if statement, it would automatically return that value within the if statement and not go on, awesome!

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว +1

      Your welcome :)

  • @NourAli-hl4ih
    @NourAli-hl4ih 6 ปีที่แล้ว +1

    Amazing I am taking data structure in less than a month so this was great kick start

    • @MarcusBiel
      @MarcusBiel  6 ปีที่แล้ว

      You're welcome! Consider watching my other videos, like I have two about the data structure List...

  • @harishchowdarysure8858
    @harishchowdarysure8858 8 ปีที่แล้ว

    I have a one class who contain 5 methods
    But my requirement is in between 5 methods I want to apply locking mechanism that multiple thread can’t access at a time but rest 3 methods can be access by multiple thread at a time
    NOTE:Without using Synchronized key word

  • @nileshsuryavanshi8792
    @nileshsuryavanshi8792 5 ปีที่แล้ว +1

    for the starting two condition we are using "this" but for the last one we using "Integer"
    why?

    • @mariyakulidzhanova7082
      @mariyakulidzhanova7082 5 ปีที่แล้ว

      The compare() method of Integer class of java.lang package compares two integer values (x, y) given as a parameter and returns the value zero if (x==y), if (x < y) then it returns a value less than zero and if (x > y) then it returns a value greater than zero.

  • @eagle5759
    @eagle5759 6 ปีที่แล้ว

    Dude your awesome

    • @MarcusBiel
      @MarcusBiel  6 ปีที่แล้ว

      Thanks :) try out my free tutorials (including a pdf) on my website, also :)

  • @richardmccormack2486
    @richardmccormack2486 6 ปีที่แล้ว +1

    excellent & succinct :)

  • @maurilioblanken9684
    @maurilioblanken9684 4 ปีที่แล้ว +1

    Firework Hoorary Party!!!!

  • @harishchowdarysure8858
    @harishchowdarysure8858 8 ปีที่แล้ว +2

    comparable in java.lang package not in java.util package

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      True! I Thanks! just checked the video, the only thing that seems to be wrong is the first slide however, content seems fine. Let me know if you find anything else!

  • @jaysechase
    @jaysechase 4 ปีที่แล้ว +1

    Great vid :)

  • @joaquimsousa2267
    @joaquimsousa2267 2 ปีที่แล้ว +1

    Perfect *****

  • @rajtilak029
    @rajtilak029 6 ปีที่แล้ว

    amazing...

  • @harishchowdarysure8858
    @harishchowdarysure8858 8 ปีที่แล้ว

    Sir how mutch memory the jvm will take in out computer by default

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      +harish chowdary that depends on the JVM you use, and the settings you use. Read this: stackoverflow.com/questions/2915276/what-is-the-default-maximum-heap-size-for-suns-jvm-from-java-se-6

    • @harishchowdarysure8858
      @harishchowdarysure8858 8 ปีที่แล้ว

      Windows64 bit

    • @harishchowdarysure8858
      @harishchowdarysure8858 8 ปีที่แล้ว

      I am not asking for heap i asking entire jvm

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      That is actually even easier. Your windows task manager shows the memory used by the entire jvm. www-01.ibm.com/support/docview.wss?uid=swg21138203&aid=1

    • @harishchowdarysure8858
      @harishchowdarysure8858 8 ปีที่แล้ว

      constructor and finalize methods are called as life cycle methods of javase?

  • @yandiravivancos1162
    @yandiravivancos1162 6 ปีที่แล้ว +1

    Hola!!! gracias Marcus

    • @MarcusBiel
      @MarcusBiel  6 ปีที่แล้ว

      You're welcome! :)

  • @harishchowdarysure8858
    @harishchowdarysure8858 8 ปีที่แล้ว

    sir what is transaction? please reply me

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      There are several types of transactions - you probably refer to database transactions. You can define a set of operations as one "transaction" - now if any of the operations within that "transaction set" fails, then the state will be "rolled back" to exactly how it was BEFORE that "transaction" was executed.

  • @pejko89
    @pejko89 2 ปีที่แล้ว

    Mmmmm I want to eat the red one.....

  • @harishchowdarysure8858
    @harishchowdarysure8858 8 ปีที่แล้ว

    In our computer

  • @MrTechGeek01
    @MrTechGeek01 8 ปีที่แล้ว

    (y)

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว

      +MrTechGeek01 ?

    • @MrTechGeek01
      @MrTechGeek01 8 ปีที่แล้ว

      sorry if you don't understand this is shortcut for (like) emoji on Facebook..in short i liked the video nice explanation.thanks

    • @MarcusBiel
      @MarcusBiel  8 ปีที่แล้ว +2

      +MrTechGeek01 no, I didn't know. Now you taught me something, too. ☺. If you have any questions just let me know.

  • @minidoffa
    @minidoffa 4 ปีที่แล้ว +1

    Not funny, did not laugh.