0

In Eclipse, when I try to run this code, it gives me an error message: "Editor does not contain a main type":

public class GalToLit {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        double gallons, liters;

        gallons = 10; //start with 10 gallons

        liters = gallons * 3.7854; //convert to liters

        System.out.println(gallons + " gallons is " + liters + " liters.");
    }

}
August
  • 12,410
  • 3
  • 35
  • 51

1 Answers1

0

You have to make sure that your .java files are in the .src folder in eclipse. I had the same exact problem until I got it figured out.