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 must a class do to implement an interface in java programming?
Can we have any code between try and catch blocks?
What is the type of lambda expression?
What programs use java?
Difference between serialization and deserialization in java?
What is polymorphism and what are the types of it?
Is assembly language a low level language?
What are the drawbacks of reflection?
Tell me a few examples of final classes defined in Java API?
What is the purpose of lambda expressions?
how can you take care of mutual exclusion using java threads? : Java thread
Is java map thread safe?
What are aggregate functions explain with examples?
What is javac_g?
What is private static class in java?