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
In Java list the methods that can be overridden?
Is there a sort function in java?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
What are the limitations of procedural programming approach?
EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.
Is array a class?
Does treeset use compareto?
What is the collections api?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
What is method overriding in java ?
How does queue work in java?
How to declare an arraylist in java?
Explain treeset?
What is meant by main method?
What is the basic difference between string and stringbuffer object?