You need to go back to the beginning of your course and read it through again.
When you declare a method using the
static
keyword, it means that it is not a property of a Car instance it is a property of the Car class: it is shared by all instances and does not need an instance to be used.
For example with a real car: "What colour is it?" is a question that only works if you ask it about a specific car: "What colour is my car?", "What colour is your car?", "What colour is this car?", "What colour is that car?". YOu can't ask "What colour is a car?" because all cars are not the same colour - you need an instance to ask the question:
public class Car
{
public Color GetColour() { ... }
...
}
Car myCar = new Car("Mercedes A Class", "VIN: XXXXXXXXXXXX");
Console.WriteLine(myCar.GetColour());
On the other hand, you can ask "How many wheels has a car?" and expect to get "4" as the result, because all cars have four wheels (if they had two they would be a motorbike!). The "number of wheels" is a property of the car class, not a property of teh car instance, and as such can be static:
public class Car
{
public Color GetColour() { ... }
public static int GetWheelsCount() { return 4; }
...
}
Car myCar = new Car("Mercedes A Class", "VIN: XXXXXXXXXXXX");
Console.WriteLine(myCar.GetColour());
Console.WriteLine(Car.GetWheelsCount());
A
static
method can't access anything to do with a specific instance of a Car because it is generic to all Car objects - as a result, you can't access it via a Car instance like you can GetColour to "remind you" that it isn't anything to do with that instance.
So you need to go through your fields and methods and decide which ones are specific to a particular Car, and which are general to the whole class, and remove the
static
keyword from instance related ones.
Make sense?