I have a function in Java, but I'm trying to return 3 elements from a function, but so far no luck.
public String retrieveStudentInfo() {
String name = "Miley";
String grade = "56"
String ID = "1043"
return name,grade,ID; //trying to return all the elements in this function.
}
based on the function above, I'm trying to return the name,grade and ID at the same time, through a variable like below:
String getStudentInfo = this.retrieveStudentInfo();
Could anyone please help me on this. I've specified the return data type as String but it wouldn't let me return them.