title: Error: 'void' type not allowed here
body: <p>I'm learning to use classes and part of my assignment is to make this Car class. I'm getting an error on line 6 where I attempt to print of the results of the methods within the class. I think this means that I'm attempting to print something that doesn't exist and I suspect it's the mileage method. I tried changing it to return miles, but that didn't work either. Any ideas?</p>
  
  <pre><code>public class TestCar {
    public static final void main(String args[]) {
  
      Car c = new Car ();
      c.moveForward(4);
      System.out.println ("The car went" + c.mileage() + "miles."); // &lt;-- L6
    }
  }
  
  class Car {
    public int miles = 2000;
    public void moveForward(int mf) {
      if (miles != 2000) {
          miles += mf;
      }
    }
  
    public void mileage() {
      System.out.print(miles);
    }
  }
  </code></pre>