N
news.hku.hk
i have a array of objects from the class job, i.e.
job teacher[1]
job teacher[2]
job teacher[3]
.............until job teacher[100]
these objects contain the string name of the teachers and
teacher[1].showname(); //return string "Sam Clinton"
teacher[2].showname(); //return string "John Patten"
teacher[3].showname(); //return string "John Dickens"
......... and so on........
i would like to output to screen in ascending order of teacher's name, i.e.
John Dickens
John Patten
Sam Clinton
What should i do? which kind of sorting is better, i don't know any of
them.....
Thanks for your help.
job teacher[1]
job teacher[2]
job teacher[3]
.............until job teacher[100]
these objects contain the string name of the teachers and
teacher[1].showname(); //return string "Sam Clinton"
teacher[2].showname(); //return string "John Patten"
teacher[3].showname(); //return string "John Dickens"
......... and so on........
i would like to output to screen in ascending order of teacher's name, i.e.
John Dickens
John Patten
Sam Clinton
What should i do? which kind of sorting is better, i don't know any of
them.....
Thanks for your help.