title: Return a string and integer using one method
body: <p>Im trying to write a program which has a method Exam mark 
  This contains objects of pupil class and a string that gives the pupils name. The method should return the pupils exam mark and their name. if there is a pupil called joe and their exam score is 32 then when joe is passes 32 should be printed.</p>
  
  <p>In the student class i have getters, for getexamscore and in a subclass i have the getter getpupilname.
  the vector elements should be in the pupil class.</p>
  
  <p>If the pupil is not in the class -1 should be returned.</p>
  
  <p>Here is my method and everything must be in only this method:</p>
  
  <pre><code>import java.util.*;
  public class vectors
  {
     public int lookforMark(Vector &lt;pupil&gt; v, String name)
     {
         int examscoremark=0;
         name="";
         try{
  
             for(int i=0; i&lt;=v.size(); i++){
                 try
                 {
                    int element= v.elementAt(i).getexamscore();
                    String element2= v.elementAt(i).getpupilname();
  
  
                 }
                 catch(Exception e)
                 {
                     System.out.println("there is an error");
                     return -1;
                 }  
              }
          }
  </code></pre>
  
  <p>Can someone help me on returning the exammark with the pupil name?</p>