I have a method which loads data from a Student object. I would like to be able to get a string from that method which holds the data the student class contains.
public static String getData(String order) throws IOException{
//create string array for each type of data student object can hold
String[] firstNames = new String[numberOfStudents];
String[] lastNames = new String[numberOfStudents];
String[] grade = new String[numberOfStudents];
String[] age = new String[numberOfStudents];
String[] email = new String[numberOfStudents];
for(int i = 0; i < numberOfStudents; i++){
//get data from each student object
firstNames = readFirstName(studentArray);
lastNames = readLastName(studentArray);
grade = readGrade(studentArray);
age = readAge(studentArray);
email = readEmail(studentArray);
}
//HERE i would like to be able to order by first name or last name but i //would like to keep the last name and grades with its own first name
if(order == "FIRST_NAME"){
}else{
}
return "NULL";
}
I hope I am being clear for what I am trying to achieve. It may be difficult to understand from just looking at this method.
Thanks