Java8 | 41 | Sorting using Comparator Interface | Tamil

Ойын-сауық

➡️In this video, we will solve the same problem with the help of the comparator interface in Java. This is also a non-Java8-based solution.
*️⃣The Comparator interface in Java is used to order the objects of a user-defined class. It provides multiple sorting sequences, i.e., you can sort the elements on the basis of any data member, for example, roll no, name, age or anything else.
*️⃣The Comparator interface is found in Java. util package and contains 2 methods:
➡️compare(Object obj1,Object obj2)
➡️equals(Object element)
*️⃣The compare() method is used to compare two objects of the same class. It returns an integer value, which indicates the order of the two objects. The return value is as follows:
➡️-1 if obj1 is less than obj2
➡️0 if obj1 is equal to obj2
➡️1 if obj1 is greater than obj2
*️⃣The equals() method is used to check if two objects are equal. It returns true if the two objects are equal, and false otherwise.
*️⃣The Comparator interface can be used in the following ways:
➡️To sort the elements of a collection.
➡️To compare two objects of the same class.
➡️To provide an ordering for collections of objects that don't have a natural ordering.
Support by donating:
---------------------------------
Google Pay UPI Id: arulprasath36@okicici
Name: Arulprasath
Email: arulprasath36@gmail.com
Follow me on Linked In: / arulprasath-ranganatha...
Instagram: im_arulprasath
website: www.arulprasathranganathan.com
You can watch my other tutorials
------------------------------------------------------
Selenium basics: bit.ly/2XtOt1F
Selenium Advanced: bit.ly/2WYieZe
TestNG Absolute Beginner Guide: bit.ly/2N6xgaM
Data-driven framework: bit.ly/2WVjSFT
Page Object Model: bit.ly/2IAXJZR
Framework development using POM and Cucumber: rb.gy/fer4sw
Keyword driven framework development: rb.gy/gosduk
How to write XPath on our own: bit.ly/2KwMLql
Must know Java concepts for Selenium: bit.ly/31Ro7G8
Selenium Interview Questions: bit.ly/2N6xu1F
Java for Selenium Automation: bit.ly/2IylOAh
Maven beginner guide: bit.ly/2Rsigm0
GitHub Absolute beginner Guide: bit.ly/2Kxdzqj
REST Web services beginner guide: bit.ly/2N69rQq
Cucumber absolute beginner guide: bit.ly/2X0lSBB
Acceptance Testing (Fitnesse) beginner guide: bit.ly/2Y6oE55
Jenkins beginner guide: bit.ly/2X39fGb
Jmeter beginner tutorials: bit.ly/32achqW
Java programs for Interview: bit.ly/3AZ5u4M
Frequently Asked Interview questions for testers: bit.ly/3xFfyhm
Agile beginner tutorials: bit.ly/3khmT2z
Jira beginner tutorials : bit.ly/2TZLE97
Rest Assured beginner tutorials: bit.ly/3i4lpGw
Selenium Exceptions: bit.ly/36BpYCS
Manual testing tutorials: rb.gy/htjdm4
Freshers Tips and Guidance: rb.gy/m97ze8
ISTQB Foundation level Videos: rb.gy/erkss9
Postman Absolute beginner Tutorials: rb.gy/u5hds6
Roadmap for Freshers and Professionals: rb.gy/vuhvap
Complete Rest Assured Tutorials: rb.gy/3wgta9

Пікірлер

    Келесі