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 are the restriction imposed on a static method or a static block of code?
State some situations where exceptions may arise in java?
write a program that list all permutations of ABCDEF in which A appears before B?
What is the synonym of procedure?
How do you check if a number is a perfect square?
How to run a JAR file through command prompt?
What do you mean by Hash Map and Hash Table?
How does class forname work in java?
How java enabled high performance?
Is null an object java?
What are keyboard events?
What is the need of transient variables in Java ?
What is class forname used for?
How do you start a new line in java?
What is a void method java?