// JP opened flex table

Click to See Complete Forum and Search --> : Need Some Help


jblight
May 12th, 2008, 12:10 PM
Hey everybody, currently working on a university project which is asking us to develop a student mentoring program that can create students assign them to a mentoring program and assign mentees and mentors to one another. One of the methods that we are being asked to include is

public Mentor getMentor(String id) which takes a parameter of a student id and returns a Mentor object if the Student found (if one exists) is in fact a Mentor, or it returns null if there is no such student, or the student is not a mentor.

Now all the classes are set up and the student id is a String variable called studNumber

Student
Mentoring
Mentor
Mentee

How could i do this :(

petes1234
May 12th, 2008, 01:24 PM
I assume that this is not a database, but that you are using simpler data structures. I also assume that each student ID is unique. If so, then an easiest way to do this is to use a generic Map<String, Mentor> object from the Collections library such as a HashMap.

//JP added flex table