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 the default value of an object reference declared as an instance variable?

1054


Explain oops concepts in detail?

974


Can we call the run() method instead of start()?

991


Why can't we make a class private in java?

983


Explain about collection interface in java?

941


When should you make a function static?

938


What is meant by inheritance and what are its advantages?

1049


how to write a program for sending mails between client and server

2032


What kind of variables a class can consist of?

1050


What is __ init __ functions?

1047


Does collectionutils isempty check for null?

1377


How do you convert string to int in java?

1026


How do you use substring in java?

1070


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

1064


How to display all the prime numbers between 1 and n (n is the number, get the input from user)

936