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 ststic with example
Java Compiler is stored in JDK, JRE or JVM?
What are the two parts of a conditional statement?
What is the common usage of serialization? What exceptions occur during serialization?
What is an example of character?
Explain java coding standards for methods?
What is a java list?
Is it possible for yielded thread to get chance for its execution again ?
What is ascii format?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
List some features of the abstract class.
Can a static class have a constructor java?
Can we extend private class in java?
What is a Presistent Object?
Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.