How to sort a vector elements that contains the user define
class object? (Note: If Suppose consider, A Student class
contain two data members. They are String studentName and
int rollNo. I am creating Four objects for this class, each
object contains students details like name and roll no. Now
i am storing that objects in vector and if i retiving the
elements from the vector means then it should be display in
sorting order)
Answer Posted / kalyan g
other way to achieve this is implementing comparator
interface and implement compare(object) method.
Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is meant by design patterns?
What is keyword and identifier?
What is the purpose of java?
What is the difference between stored procedure & function?
What is Session reduplication and how its done?
Where is stringbuffer stored?
Is there any sort function in java?
What is the applet security manager, and what does it provide?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
What is args length in java?
String class is defined under which package in java?
What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?
How many unicode characters are there?
Can we override the overloaded method?
Does treeset use compareto?