Java Comparable interface with funny animation

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии •

  • @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 RUclips that is actually helpful for beginners!

  • @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? :)

  • @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.

  • @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

  • @alexsora624
    @alexsora624 3 года назад

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

  • @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 7 лет назад +2

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

  • @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 11 месяцев назад

    bro really made java funny lol

  • @habibbenmammar2203
    @habibbenmammar2203 8 лет назад +1

    thanks marcus, it was clear and clean

  • @sfundoy5dube59
    @sfundoy5dube59 2 года назад

    Well explained, much appreciated sir🙏✨

  • @longkesh1971
    @longkesh1971 Год назад

    Thank you for making this video.

  • @Djaoverpower
    @Djaoverpower 3 года назад

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

  • @alphanelmas1662
    @alphanelmas1662 4 года назад +1

    Clear explanation thanks sir

  • @nikeshsingh2081
    @nikeshsingh2081 Год назад

    Nice explanation 🙏

  • @NourAli-hl4ih
    @NourAli-hl4ih 5 лет назад +1

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

    • @MarcusBiel
      @MarcusBiel  5 лет назад

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

  • @jlestua
    @jlestua 8 лет назад +1

    thanks Marcus for the explanation!

    • @MarcusBiel
      @MarcusBiel  8 лет назад

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

  • @joaquimsousa2267
    @joaquimsousa2267 2 года назад +1

    Perfect *****

  • @mackensonreginaldmichel399
    @mackensonreginaldmichel399 3 года назад

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

  • @saadmanahmed860
    @saadmanahmed860 5 лет назад +1

    good illustration..

  • @dilipjain9581
    @dilipjain9581 8 лет назад +2

    you are explain too good.

    • @MarcusBiel
      @MarcusBiel  8 лет назад

      +Dilip Jain Thanks Dilip! :)

  • @jaysechase
    @jaysechase 4 года назад +1

    Great vid :)

  • @eagle5759
    @eagle5759 6 лет назад

    Dude your awesome

    • @MarcusBiel
      @MarcusBiel  6 лет назад

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

  • @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.

  • @maurilioblanken9684
    @maurilioblanken9684 4 года назад +1

    Firework Hoorary Party!!!!

  • @richardmccormack2486
    @richardmccormack2486 5 лет назад +1

    excellent & succinct :)

  • @xskieojokoja3703
    @xskieojokoja3703 7 лет назад

    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  7 лет назад

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

  • @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

  • @yandiravivancos1162
    @yandiravivancos1162 6 лет назад +1

    Hola!!! gracias Marcus

  • @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!

  • @rajtilak029
    @rajtilak029 6 лет назад

    amazing...

  • @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 :)

  • @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 :)

  • @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?

  • @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.