Core Java With OCJP/SCJP: Collections Part-10 || string object in Treeset Example
ฝัง
- เผยแพร่เมื่อ 5 ก.ย. 2024
- java
Basic Java Tutorial for beginners
Basic Java Programming for beginners
Core Java By Durga Sir
Core Java
Core Java Video Tutorials
Core Java Tutorial for beginners with examples
Core Java Tutorial
Core Java DURGASOFT
Durgasoft Core Java
Durgasoft Java
durga software solutions core java videos
durga software solutions java
How to learn java
How to learn java programming language for beginners
learn java
learn java programming for beginners
programming in java
understanding java
java application development tutorial
java beginner tutorial
java basics for beginners
java for beginners
java lessons
java lectures
java language tutorial for beginners
java programming tutorial
java programming for beginners
java tutorial for beginners
java tutorial
java tutorial by durga sir
====================================
Java tutorial by durga sir
goo.gl/XWb4RL
Java 9 by durga sir
goo.gl/hXGyBW
Java 1.8 Version New Features by Durga sir
goo.gl/iHXXYU
Adv Java JDBC Tutorial by Durga sir
goo.gl/8q16Eo
OCJA 1.8 Java SE 8 Programmer - I (1Z0 - 808 ) By Durga sir
goo.gl/gC6R7f
Core Java by NagoorBabu sir
goo.gl/s6Nvj1
Advenced Java by Nagoorbabu sir
goo.gl/ZZonzJ
CoreJava by Ratan
goo.gl/3VM19v
Advanced Java jdbc by Ratan
goo.gl/Rn2UXr
Advjava tutorials - JSP by Ratan
goo.gl/Z6ytxm
Adv java servlets tutorial by ratan
goo.gl/zTwi9y
Servlet and JSP Tutorial by anji reddy
goo.gl/jZMRUv
Advanced Java Jdbc by Anjireddy
goo.gl/16CGzX
Hibernate byAnjireddy
goo.gl/qQojvZ
Struts by Anjireddy
goo.gl/nE1Eof
Spring by Mr.AnjiReddy
goo.gl/NfN14R
ADV JAVA by Naveen
goo.gl/bhSsXF
Spring by Mr.Naveen
goo.gl/huVwFN
Hibernate by Mr. Naveen
goo.gl/TY3Wpd
Struts by Mr.Naveen
goo.gl/Vkmiw7
India needs more teacher Like you. Things in which I'm struggling is now crystal clear. Thanks for everything.
Very nice Explanation Sir....Sir You are the Aanand kumar(Super 30) of Java Language. Your explanation is very heplful for All the Students who wants to Learn java beacause Learning java via another source or by any other faculty is very very difficult ....Durga sir is the only one who make java as simple as possible for students....Through durga sir knowledge, we can give left and right to the interviewer and sir is passionate about java..by getting a knoeledge from the durga sir session now I can think manually how to work in real time...salute to durga sir for their dedication and thank you so much sir. In my life time I want to see you once...Ultimate teaching style sir....superbb I am a big fan of your sir...once again thank you so much durgasoft team and special thanx to durgasir from the bottom of my Heart....Tanish Mahajan
Me to bro...
Sir can I learn Coding from Durga Sir videos??
I completely agree...Best teacher of Java in my opinion. I have gone through multiple resources, I think but durga sir's java videos as the best!!
Starting from jdk 11, StringBuffer has implemented Comparable.
thanks
Thank you
why i prefer watching your long videos than other short videos is that concepts are going very strong into head.
Hello Friend.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
🎉This video was incredibly informative and well-made.🎉 Thank you for sharing this priceless knowledge ✨
Attention⚠
In new versions StringBuffer and StringBuilder also implementes Comparable interface... ❤
thank you so much sir you explained Java Language in a very very detailed way with depth. Now it is easy to understand to anyone, it does not matter whether students are from CS background or not. you are a genius in Java Language. Thank you thank you thank you sir for clearing my all doubts, thank you for providing the most valuable knowledge freely to us on youtube. God will give a lot of Happiness, Health, and wealth to you. Love you sir.... love you ....
Hello Friend.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
i really want to know why those 13 dislikes are there ,what is the reason ? ,The durga sir is the great teacher ,sir thanks for all collection tutorial videos ,God bless you
Hello Akash.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
They are followers of the political party, he gave example from.. lol..
They want to learn everything in 1 hour i guess 🤣
This is the best explanation on Comparator so far..... ❤❤ you made everything crystal clear❣
Hello Friend.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
sir the knowledge we get from your classes is of great worth.We have to refer many books or articles to get this type of stuff.Through your classes we are able to achieve that easily.Thanks again..
Hello Sri Vani.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Nobody is like you, In one word you are great.🙏
Hello Friend.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Thanks a lot for all ur videos. Its very help full to understand the concept in depth and ur teaching style is awesome.
below is my observation, pls correct if i am wrong.
Without using Comparator, we can convert StringBuffer toString, will give the same result.
TreeSet t = new TreeSet();
t.add(new StringBuffer("Test").toString());
t.add(new StringBuffer("NewTest").toString());
Thank you very much sir , you are the Best.. Java Mega Power Star Durga sir
Hello Sai Prabath.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
You are too good Durga Sir! Hats off to you!! Your videos have been very helpful to me
Hello mmcooe.
Thanks for your valuable feedback.It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Completed this video
Day 64 of #75daysofcode in Java
19 May, 2024
Again Thank You. Thank You.
too much knowledge thanks my mind is full for now
Hello Ahmid.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Thanks for awesome videos.
Can you please elaborate why equals is included in Comparator(I) ?
What is it's purpose?
145 video completed.. 🎉❤
Sir You are Excellent and wonderful
Hello Vivek.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/kqvaf2
Thank you so much sir..:)..:)
Hi ,
Natural sorting order of StringBuffer works well in TreeSet (java 11). but you have mentioned not working.. please clarify
Hello Karthik.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
Thanks so much, Durga Sir.
sir in newer version of java Stringbuffer implements comparable
Yes you are right !!
thank you sir
@Durga sir, I understand the basics including d concepts also while u r teaching bt sir, how to remember all these syntaxes? I mean sir these r so difficult to remeber all steps... Can u tell whts d procedure plz???
And thank you sir for ur free teaching classes. Staying in India u r lyk real hero sir. 🙏
Hello Haso.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
sir please upload. ' durga sir string manipulation ' videos
Thank you Sir for the video
Thankyou sir
ThAnks sir
Nice Explanation
your explanation is excellent sir could you please explain how to sort linked list by using comparator
Hello Vijaya.
Thanks for your valuable feedback. It will boost us to do new things. Please subscribe to get updates about new videos.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627,7207212427/28
love durgasoft
Sir I have one doubt You have used comparable for natural sorting on empid. but for string sorting u have used comparator. Don't we use natural sorting for alphabet checking?
Hello Friend.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
🤩👏👌🐎🥳
Hello durga sir,
Sir for sorting heterogeneous non comparable objects can we take combination of int and string instead of string and stringbuffer ??
Can you please provide program for SortedSet??
Hello Mohan.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
Can we write own sorting by comparable (compareTo(ob j) ? Example : we can also compare Employee name compareTo() method itself . But Which one is good to choose ?
Thank u very much sir... I saw total 199 videos.. Sir in this video... Comparator example not executing in 1.8v.. Why sir.. Wt is d reason....
Hello Shashi Kumar.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
endless sir
Sir , new version bhi upload krdo java ke
Hello Sumit.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
Sir Can we implement sorting for homogeneous data of two element simultaneously e.g
if we take String name and string department as input so I want my output should be of alphabetical order of name & department both simultaneously.
Please let me know how
Hello Parag.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
You are awesome...so nicely expalined and presented..
one doubt
how add(object) calls internally to comapareto() method could you explain ?
and how Treeset t = new TresSet(Comparator r ) gives Treeset Comparator property ?
Agree!! Very well explained. I have the same doubt. Durga Sir, Can you please resolve this query? Thanks in Advance!!
When you create the object of TreeSet using 'new' keyword, it creates the instance of TreeMap. And calling 'add( )' method of TreeSet internally calls the 'put( )' method of TreeMap(), where it calls the comapre( ) method.
why can't we use comparator for stringbuilder object ? i meand we can cast StringBuffer to String Object and use that string to call the compareTo method.
Sir, what is the use of equals() method in Comparator?
Hello Vineet.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
Hi Sir,
Internally HashSet using HashTable thats fine, But in HashSet Constructor they have used the HashMap() object to create the HashSet class object.
public HashSet() {
map = new HashMap();
}
Here i am not clear about that, How the HashTable actually used internally in HashSet ?
Could you please help me out
Hello Sojitra.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627,7207212427/28
sir @ 21:00 why Stringbuffer whynot String? why to convert StringBuffer to String? why not pass directly String?
Hello Divya.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
nice sir
Hello Chaudhary.
Thanks for your valuable feedback.It will boost us to do new things. Please subscribe to get updates about new videos.
You can view all other Core Java with SCJP/OCJP Videos by Durga sir in the following link:
goo.gl/U1KKyi
You an see more Java videos following link:
Java tutorial by durga sir
goo.gl/XWb4RL
Java 9 by durga sir
goo.gl/hXGyBW
Java 1.8 Version New Features by Durga sir
goo.gl/iHXXYU
Adv Java JDBC Tutorial by Durga sir
goo.gl/8q16Eo
OCJA 1.8 Java SE 8 Programmer - I (1Z0 - 808 ) By Durga sir
goo.gl/gC6R7f
Core Java by NagoorBabu sir
goo.gl/s6Nvj1
Advenced Java by Nagoorbabu sir
goo.gl/ZZonzJ
CoreJava by Ratan
goo.gl/3VM19v
Advanced Java jdbc by Ratan
goo.gl/Rn2UXr
Advjava tutorials - JSP by Ratan
goo.gl/Z6ytxm
Adv java servlets tutorial by ratan
goo.gl/zTwi9y
Servlet and JSP Tutorial by anji reddy
goo.gl/jZMRUv
Advanced Java Jdbc by Anjireddy
goo.gl/16CGzX
Hibernate byAnjireddy
goo.gl/qQojvZ
Struts by Anjireddy
goo.gl/nE1Eof
Spring by Mr.AnjiReddy
goo.gl/NfN14R
ADV JAVA by Naveen
goo.gl/bhSsXF
Spring by Mr.Naveen
goo.gl/huVwFN
Hibernate by Mr. Naveen
goo.gl/TY3Wpd
Struts by Mr.Naveen
goo.gl/Vkmiw7
Is k.add("a r rahman") valid ?
Hello Friend.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
One doubt, if anyone can help me out. Does Comparator implements Comparable Interface ?? If not then how we are using compareTo() method of comparable interface in MyComparator class which implements Comparator.
Hello Aashqar Khan.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
Do you get answer for your question? if so, can you please post it.
Yeah...and that is why programm while executing showing error
CompareTo is used for string in mycomparator class and string implements compareTo method
No comparator doesn't implement comparable,if it implements comparable then the class which implements comparator must have to implement both interface class methods which doesn't make any sense.
Since string class implements comparable interface, we can call compareTo( ) method on it's object
Eg: public Demo{
public static void main(String args[ ])
{ System.out.println("a".compareTo("b"));}
}
O/p: -1
Hope it helps :)
At 39:08 is the program allow duplicates??
Hello Rajat.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
No duplicates will be allowed as there length will same then else part will execute Default compareTo()
method and in that if two strings are same then it will return Zero and that string will be ignored."A".compareTo("A") will retrun zero.
53:40
StringBuffer is comparable. I am not sure why he is saying StringBuffer does not implement Comparable.
EDIT: Java 11 which is LTS, has started to implement Comparable to StringBuffer. Thanks to @Shikanjiwala for helping me to improve upon my comment.
Hello Dinkarinjosh.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
भाई तू कही से गलत पढ़ लिया है । ठीक से चेक कर ।
@@dinkarinjosh Bro Now you are checking in your updated java.Video is 4 years old at that time StringBuffer does not implement Comparable.As you only saying "java 11 StringBuffer has started to have comparable." That's true but earlier version does'nt implement Comparable.
docs.oracle.com/javase/7/docs/api/java/lang/StringBuffer.html
Hope now it will be clear
It is worse than that. It is highly dangerous to place any kind of mutable object in a HashSet or TreeSet, or as a key in a HashMap or TreeMap. If it changes the whole Set or Tree is now broken. This is the reason that StringBuilder/StringBuffer, which are classical cartoon stereotypes of the most mutable objects, didn't bother to implement it. I am not necessarily saying that it was the wrong thing to do it, but maybe they got jealous of C++ and how easy it was to blow yourself up or run yourself over in C++.
Hi ,
Natural sorting order of StringBuffer works well in TreeSet (java 11). but you have mentioned not working.. please clarify
Hello Karthik.
Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
Thnx sir
sir please upload. ' durga sir string manipulation ' videos