I have a simple object called car:
public class Car{
int numMiles;
int year;
//default constructor
Car(){
System.out.println("Car created");
}
My question is this: If instantiate a number of cars (car1, car2, .., car100), is there any way for a user to nominate a particular car and modify its numMiles. This obviously won't work:
String myCar;
//user selects the car somehow but for here lets say
myCar="Car1";
myCar.numMiles=4000;
=====================================================