Java Comparable interface with funny animation

  Рет қаралды 47,573

Marcus

Marcus

Күн бұрын

Пікірлер: 75
@BlueFlow
@BlueFlow 8 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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 жыл бұрын
Thank you for this! Maybe the only video on this subject here on KZbin that is actually helpful for beginners!
@manikanta-sr3zc
@manikanta-sr3zc 5 жыл бұрын
Sir very thanks you have explained to us in the best manner and in animation even non developer can also understand very easily
@j_thom
@j_thom 6 жыл бұрын
Teaching style is simply amazing! Where's your Nobel Peace prize?
@MarcusBiel
@MarcusBiel 6 жыл бұрын
LOL. Are you making fun of me? :)
@prakashbawge3688
@prakashbawge3688 4 жыл бұрын
Too good sir ,I have never seen like this type of teaching skills,will give suggestion to my son also to follow u
@RedEyedJedi
@RedEyedJedi 7 жыл бұрын
"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 :)
@JMTorresDupri
@JMTorresDupri 7 жыл бұрын
Marcus. I really appreciate this explanation. Was perfect for me. The best for you.
@MarcusBiel
@MarcusBiel 7 жыл бұрын
Thanks! Your welcome! :)
@Genesyxx
@Genesyxx 5 жыл бұрын
a very clear and concise tutorial. great job!
@alexsora624
@alexsora624 3 жыл бұрын
you're a god helped me out with my university assignment
@rachanabennur9457
@rachanabennur9457 3 жыл бұрын
That was such a clean and clear explanation! thank you so much!
@MR2SpyerJournal
@MR2SpyerJournal 7 жыл бұрын
You know, using illustrations like you do is great! Very helpful. I wish Java Docs were as useful as your video. haha
@sfundoy5dube59
@sfundoy5dube59 2 жыл бұрын
Well explained, much appreciated sir🙏✨
@tarajano1980
@tarajano1980 7 жыл бұрын
"Initially you dont create clean code" ... oh boy ! that was a big relieve for me and my sanity :-D
@MarcusBiel
@MarcusBiel 7 жыл бұрын
:) 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!
@habibbenmammar2203
@habibbenmammar2203 8 жыл бұрын
thanks marcus, it was clear and clean
@MarcusBiel
@MarcusBiel 8 жыл бұрын
+Goldorak DZ perfect :)
@alphanelmas1662
@alphanelmas1662 4 жыл бұрын
Clear explanation thanks sir
@nikeshsingh2081
@nikeshsingh2081 Жыл бұрын
Nice explanation 🙏
@moha_kunX
@moha_kunX 11 ай бұрын
bro really made java funny lol
@NourAli-hl4ih
@NourAli-hl4ih 5 жыл бұрын
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...
@Djaoverpower
@Djaoverpower 3 жыл бұрын
wouldn't it work even if we don't wright "comparable " in the Apple class creation ??
@longkesh1971
@longkesh1971 Жыл бұрын
Thank you for making this video.
@saadmanahmed860
@saadmanahmed860 5 жыл бұрын
good illustration..
@MarcusBiel
@MarcusBiel 5 жыл бұрын
Thanks :)
@jlestua
@jlestua 8 жыл бұрын
thanks Marcus for the explanation!
@MarcusBiel
@MarcusBiel 8 жыл бұрын
Your welcome! Let me know if I can help you with anything.
@joaquimsousa2267
@joaquimsousa2267 2 жыл бұрын
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?
@dilipjain9581
@dilipjain9581 8 жыл бұрын
you are explain too good.
@MarcusBiel
@MarcusBiel 8 жыл бұрын
+Dilip Jain Thanks Dilip! :)
@nileshsuryavanshi8792
@nileshsuryavanshi8792 5 жыл бұрын
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 :)
@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.
@maurilioblanken9684
@maurilioblanken9684 4 жыл бұрын
Firework Hoorary Party!!!!
@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 :)
@richardmccormack2486
@richardmccormack2486 5 жыл бұрын
excellent & succinct :)
@jaysechase
@jaysechase 4 жыл бұрын
Great vid :)
@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
@harishchowdarysure8858
@harishchowdarysure8858 8 жыл бұрын
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!
@yandiravivancos1162
@yandiravivancos1162 6 жыл бұрын
Hola!!! gracias Marcus
@MarcusBiel
@MarcusBiel 6 жыл бұрын
You're welcome! :)
@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 жыл бұрын
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 жыл бұрын
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?
@rajtilak029
@rajtilak029 6 жыл бұрын
amazing...
@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.
@harishchowdarysure8858
@harishchowdarysure8858 8 жыл бұрын
In our computer
@pejko89
@pejko89 2 жыл бұрын
Mmmmm I want to eat the red one.....
@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 жыл бұрын
+MrTechGeek01 no, I didn't know. Now you taught me something, too. ☺. If you have any questions just let me know.
@minidoffa
@minidoffa 4 жыл бұрын
Not funny, did not laugh.
Shallow vs Deep Copy in Java
8:22
Marcus
Рет қаралды 88 М.
#95 Comparator vs Comparable in Java
15:43
Telusko
Рет қаралды 207 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 62 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 27 МЛН
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1,1 МЛН
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 973 М.
Comparator Interface Java | Java Tutorial für Fortgeschrittene
13:42
Christian Programmiert
Рет қаралды 3,6 М.
Immutable Objects in Java
16:03
Marcus
Рет қаралды 28 М.
Writing a Java compareTo Method (Comparable interface)
9:11
Logic Lambda
Рет қаралды 19 М.
Comparable Interface vs Comparator Interface | Java Tutorial
8:25
Java Coding Community
Рет қаралды 2,8 М.
Interfaces Part 5:  Comparable Interface (Java)
7:45
Nathan S
Рет қаралды 90 М.
you will never ask about pointers again after watching this video
8:03
Lambda Expressions in Java - Full Simple Tutorial
13:05
Coding with John
Рет қаралды 772 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН