public void calcVehicle (Vehicle types)
//The input into this method is coming from another program
//it has been tested ok
Vehicle [ ] types= new Vehicle [numberOfVehicles];
for (int i=0; i<(numberOfVehicles);
{
System.out.println ("The Vehicle type is: "+types);
}//end for loop
}//end method calcVehicle
I have also tried
for (int i=0; i<(numberOfVehicles);
{
Vehicle type = types[i];
//and then printing out types [i] but I got null?
I don't understand how I read an array that is coming into a method. I could have any number for the array size so need the for loop. But what does Vehicle @765291 mean? Is is the place stored in memory, if so something must be coming in and if so I do I get the
String value? Do I cast it? And if so why is this necessary?