Hi..I just want to ask for a help.
I have an Array of Object Person which has these attributes
1.first name(of type String)
2.middle initial(of type character)
3.last name (of type String)
4.age(of type int)
Now my problem is, how to sort this in ascending order?
My basis of sorting is the "age variable".
Say for example:
/*inputs*/
{
*Person1
first Name:mike
middle initial:m
last name:martin
age:19
*Person2
Name:frank
middle initial:s
last name:gaze
age:17
**Person3
Name:cindy
middle initial:f
last name:hallow
age:12}//end inputs
So my goal is to sort that Array of Object Person(using selection sort, and the basis of sorting is the "age variable".
So that the output, would something look like this.
/*outputs*/
{
**Person3
Name:cindy
middle initial:f
last name:hallow
age:12//since her age is the smallest
*Person2
Name:frank
middle initial:s
last name:gaze
age:17//since his age is bigger than of cindy
*Person1
first Name:mike
middle initial:m
last name:martin
age:19//since his age is bigger than of frank,and cindy
}//end outputs
*that's it... pls help...I don,t know to sort it...I really need to finish my program...help me guys...
thanks... in advance..
_lightner