I have no idea what I'm screwing up here. Getting a null pointer exception seemingly on my array of Strings.
This is the method I'm calling in my main Activity:
public void initializeLocalDealer() {
String[] cars = new String[]{"Ford", "Chevy", "Chrysler", "Honda"};
Dealer dealer = new Dealer();
Dealer.setCars(cars);
}
Here's the class object I'm trying to populate.
public class Dealer {
public String name;
public Car[] car;
public Dealer() { }
public void setCars(String[] cars) {
for(int i = 0; i < cars.length; i++) {
car[i].name = cars[i];
}
}
}
What super obvious thing am I missing here?