Hi, Here's my problem, I want to use vectors, in this random example i have created an object car, with a firstname of fred (told you it was random).
My question is how can i put in the System.out.println statement the code to get fred printed? I want to get the name of the car via the vector somehow. Not just car.firstName, anyone know how i would do it? I thought it would be vector.firstname.get(1) but doesn't work.
import java.io.*;
import java.util.*;
public class veh{
public static void main(String[] args) {
Contact temp = new Contact();
Vector vector = new Vector();
Contact car = new Contact();
car.firstName = "fred";
vector.addElement(car);
System.out.println(?????);
}
}
Thanks