Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is a couple of ways that you could sort a collection?
Home
JAVA
What is a couple of ways that you could sort a collection?
0
votes
asked
Jan 27, 2020
in
JAVA
by
rahuljain1
What is a couple of ways that you could sort a collection?
#sort-collection
Java-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 27, 2020
by
SakshiSharma
You can either use the Sorted collection like TreeSet or TreeMap or you can sort using the ordered collection like a list and using Collections.sort() method.
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Related questions
0
votes
Q: Name couple of method overloading best practices in Java?
asked
Jan 27, 2020
in
JAVA
by
rahuljain1
#java-overloading
Java-questions-answers
+2
votes
Q: Can you write a Java class that could be used both as an applet as well as an application?
asked
May 12, 2021
in
JAVA
by
rajeshsharma
java-class
java-application
java
Java-questions-answers
+2
votes
Q: Is it correct to say that due to garbage collection feature in Java, a java program never goes out of memory in Java?
asked
May 31, 2020
in
JAVA
by
SakshiSharma
#java-garbage-collection
#garbage-collection-java
Java-questions-answers
0
votes
Q: The configuration setting in redis.conf that could be configured to the umber of samples of keys to maxmemory-samples
asked
Feb 16, 2020
in
JAVA
by
rahuljain1
Java-questions-answers
0
votes
Q: Which is a collection of terms that share some sort of relationship with each other.The vocab is not part of any hierarchy:
asked
Apr 3, 2021
in
Drupal - A Content Vault
by
Robindeniel
drupal-mcq-pdf
drupal-interview-questions
drupal-mcq-quiz
drupal-interview-questions-and-answers
drupal-8-mock-test
drupal-questions-and-answers
0
votes
Q: How to sort Collection in Java 8?
asked
Aug 4, 2023
in
JAVA
by
DavidAnderson
java8-interview-questions-answers
+1
vote
Q: Write a program to do bubble sort on an array in java.
asked
Oct 24, 2020
in
JAVA
by
sharadyadav1986
#bubble-sort-java
#java-bubble-sort
Java-questions-answers
0
votes
Q: How to sort a string in java?
asked
Oct 21, 2020
in
JAVA
by
rahuljain1
#sort-a-string
#string-sort-java
Java-questions-answers
0
votes
Q: If we sort a list of strings how would be the strings arranged?
asked
Oct 13, 2020
in
JAVA
by
SakshiSharma
#sort-a-list
#list-of-strings
#strins-arranged
Java-questions-answers
0
votes
Q: How can we sort a list of elements in Java?
asked
Oct 13, 2020
in
JAVA
by
SakshiSharma
#sort-a-list-of-elements
#elements-in-java
#java-elements
Java-questions-answers
...