Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is this keyword used for?

1064


What is identifier with example?

994


What are the loops in java?

947


How does list work in java?

864


Is string passed by reference in java?

954


Variable of the boolean type is automatically initialized as?

960


Is it possible to override the main method?

927


Is ++ operator thread-safe in java?

1100


What are meta-annotations?

932


What is java util?

972


What is string manipulation?

947


What do you mean by JVM?

1010


Are static members inherited to sub classes?

1088


How do you use parseint in java?

936


What is nested loop? What is dangling else condition in it?

1021