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.
:) 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 ...
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.
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" ?
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
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!
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 :)
? 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?
+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
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
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.
I've been a Java Developer for about 5 years now. I wish I had someone like you explaining basic things like this. +1
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.
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!
Thank you for this! Maybe the only video on this subject here on RUclips that is actually helpful for beginners!
Teaching style is simply amazing! Where's your Nobel Peace prize?
LOL. Are you making fun of me? :)
"Duplicate code is evil" hahaha. I love that bit. So happy I found your channel, it's really helping me a lot.
You're welcome :)
Sir very thanks you have explained to us in the best manner and in animation even non developer can also understand very easily
you're a god
helped me out with my university assignment
Too good sir ,I have never seen like this type of teaching skills,will give suggestion to my son also to follow u
Marcus. I really appreciate this explanation. Was perfect for me. The best for you.
Thanks! Your welcome! :)
a very clear and concise tutorial. great job!
That was such a clean and clear explanation! thank you so much!
You know, using illustrations like you do is great! Very helpful. I wish Java Docs were as useful as your video. haha
"Initially you dont create clean code" ... oh boy ! that was a big relieve for me and my sanity :-D
:) 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 ...
Red, Green, Refactor!
bro really made java funny lol
thanks marcus, it was clear and clean
+Goldorak DZ perfect :)
Well explained, much appreciated sir🙏✨
Thank you for making this video.
wouldn't it work even if we don't wright "comparable " in the Apple class creation ??
Clear explanation thanks sir
Nice explanation 🙏
Amazing I am taking data structure in less than a month so this was great kick start
You're welcome! Consider watching my other videos, like I have two about the data structure List...
thanks Marcus for the explanation!
Your welcome! Let me know if I can help you with anything.
Perfect *****
Thanks for the viodeo. I have a problem. sometimes I see that people put .... implements . Why they do that? why you do something different?
good illustration..
Thanks :)
you are explain too good.
+Dilip Jain Thanks Dilip! :)
Great vid :)
Dude your awesome
Thanks :) try out my free tutorials (including a pdf) on my website, also :)
for the starting two condition we are using "this" but for the last one we using "Integer"
why?
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.
Firework Hoorary Party!!!!
excellent & succinct :)
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" ?
Is that a rhetorical question? If not, just try it out by yourself, this will help you way more then me telling you.
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
Hola!!! gracias Marcus
You're welcome! :)
comparable in java.lang package not in java.util package
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!
amazing...
Can you explain what this.weight means? at 5:40s when overriding compareTo.
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 :)
@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?
? 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?
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!
Your welcome :)
Sir how mutch memory the jvm will take in out computer by default
+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
Windows64 bit
I am not asking for heap i asking entire jvm
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
constructor and finalize methods are called as life cycle methods of javase?
sir what is transaction? please reply me
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.
Mmmmm I want to eat the red one.....
In our computer
(y)
+MrTechGeek01 ?
sorry if you don't understand this is shortcut for (like) emoji on Facebook..in short i liked the video nice explanation.thanks
+MrTechGeek01 no, I didn't know. Now you taught me something, too. ☺. If you have any questions just let me know.
Not funny, did not laugh.