Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Cant display information

  Asked By: Nichole    Date: Apr 10    Category: Java    Views: 565
  

could anyone help me out with displaying information from my Vehicle
class through my Controller class to my View class. i want to display
the car details onscreen without any print() lines in the vehicle or
controller classes. has any 1 got a solution heres some code.

Vehicle Class

private int findVehicle(String regNo) {

int location = -1;

for(int i = 0; i < vector.size(); i++) {
if(vector.get(i) instanceof Car) {
Car car = (Car)vector.get(i);
if(car.getRegNo().equalsIgnoreCase(regNo)) {
location = i;
}
}
if(vector.get(i) instanceof Van) {
Van van = (Van)vector.get(i);
if(van.getRegNo().equalsIgnoreCase(regNo)) {
location = i;
}
}
}
return location;
}

public void displayDetails(String regNo) {
vector.get(findVehicle(regNo));
}

Controller Class

private void displayDetails() {
String regNo = output.getTheRegNo();

vehicle.displayDetails(regNo);

//output.displayVehicle();
}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Cant display information Or get search suggestion and latest updates.




Tagged: