{"id":21485178,"url":"https://github.com/sarabdevops/comparable-and-comparator","last_synced_at":"2025-08-11T20:13:22.748Z","repository":{"id":228053193,"uuid":"332336360","full_name":"sarabDevOps/Comparable-and-Comparator","owner":"sarabDevOps","description":"Comparable and Comparator in Java","archived":false,"fork":false,"pushed_at":"2021-02-07T03:53:29.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T09:49:49.572Z","etag":null,"topics":["comparable","comparator","eclipse-ide","java","set","treeset"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sarabDevOps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-01-24T00:25:41.000Z","updated_at":"2021-02-07T03:53:31.000Z","dependencies_parsed_at":"2024-03-16T18:56:19.288Z","dependency_job_id":"cc5bdec1-8bc2-4433-867a-ca6820380e7f","html_url":"https://github.com/sarabDevOps/Comparable-and-Comparator","commit_stats":null,"previous_names":["sarabdevops/comparable-and-comparator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sarabDevOps/Comparable-and-Comparator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarabDevOps%2FComparable-and-Comparator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarabDevOps%2FComparable-and-Comparator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarabDevOps%2FComparable-and-Comparator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarabDevOps%2FComparable-and-Comparator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarabDevOps","download_url":"https://codeload.github.com/sarabDevOps/Comparable-and-Comparator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarabDevOps%2FComparable-and-Comparator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269948859,"owners_count":24501821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comparable","comparator","eclipse-ide","java","set","treeset"],"created_at":"2024-11-23T13:14:23.238Z","updated_at":"2025-08-11T20:13:22.725Z","avatar_url":"https://github.com/sarabDevOps.png","language":"Java","readme":"# Comparable-and-Comparator\n\n## Comparable and Comparator in Java\n\nComparable and comparator both are an interface that can be used to sort the elements of the collection. Comparator interface belongs to java.util package while comparable belongs to java.lang package. Comparator interface sort collection using two objects provided to it, whereas comparable interface compares\" this\" refers to the one objects provided to it.\n\nComparable | Comparator\n------------ | -------------\nThe comparable interface has a method compareTo(Object a ) | The comparator has a method compare(Object o1, Object O2) \nCollection.sort(List) method can be used to sort the collection of Comparable type objects | Collection.sort(List, Comparator) method can be used to sort the collection of Comparator type objects\nComparable provides single sorting sequence.|The comparator provides a multiple sorting sequence.\nComparable interface belongs to java.lang package.|Comparator interface belongs to java.util package.\n\n## Steps will guide you how to run it \n\n### Dependencies\nYou hava to have java installed to your local machine , if you dont have java here are the steps how to download it.\n1. Navigate to the Java SE Downloads page.[Click Me](https://www.oracle.com/ie/java/technologies/javase/javase-jdk8-downloads.html)\n2. Choose the JDK Download:\n3. Agree to terms and download the appropriate version. Not sure which version of Windows you are running?\n4. Open the .exe file and run the installation accepting all defaults.\n\n### Installing\n\n* You can download the zip folder from above and extract it to your local machine.\n* If you have a git install to your machine you can use git clone command to clone the project to your local machine.\n\n### Executing program\n\n* Once you have a project downloaded and extracted on your machine.\n* You can import it to your ide whatever ide you are using \n* Or you can run the program without Ide as well steps below explains how ...\n\n```\nopen the command promt cd to where your project is saved \nonce you are in the folder you can use ls or dir to see files\nthen you can compile all together using this command (javac *.java)\nNow, type ' java Runner '\nYou will be able to see the result printed on the window.\n\n```\n\n\n\n## Authors\n[sarabDevOps](https://github.com/sarabDevOps)\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE.md](https://github.com/sarabDevOps/Comparable-and-Comparator/blob/main/LICENSE)  for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarabdevops%2Fcomparable-and-comparator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarabdevops%2Fcomparable-and-comparator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarabdevops%2Fcomparable-and-comparator/lists"}