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 the meaning of course?
What is a numeric literal?
What is the difference between the prefix and postfix forms of the ++ operator?
What do you mean by singleton class in java?
What is hashing in java?
Using callable statement how can you pass out parameters, explain with example?
Why main function is static?
What is purpose of keyword void?
What is the difference in between cpp and java? Can u explain in detail?
Can inner class extend any class?
What is a java object and java application?
What is the use of jtable?
What is qms certification?
What is JDBC Driver interface?How can you retrieve data from the ResultSet
What is __ init __ functions?