I am studying defining a class in Java Programming.
I am having an issue with whenever I try to write a class, even one directly from the book, NetBeans tells me it can't find the class.
The code looks correct but it won't run. i don't understand what I am doing wrong.
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package auto; /* Auto class, Version 2 Anderson, Franceschi */ public class Auto { // instance variables private String model; // model of auto private int milesDriven; // number of miles driven private double gallonsOfGas; // number of gallons of gas // Default constructor: // initializes model to "unknown"; // milesDriven is autoinitialized to 0 // and gallonsOfGas to 0.0 public Auto( ) { model = "unknown"; } // Overloaded constructor: // allows client to set beginning values for // model, milesDriven, and gallonsOfGas. public Auto( String startModel, int startMilesDriven, double startGallonsOfGas ) { model = startModel; // validate startMilesDriven parameter if ( startMilesDriven >= 0 ) milesDriven = startMilesDriven; else { System.err.println( "Miles driven is negative." ); System.err.println( "Value set to 0." ); } // validate startGallonsOfGas parameter if ( startGallonsOfGas >= 0.0 ) gallonsOfGas = startGallonsOfGas; else { System.err.println( "Gallons of gas is negative" ); System.err.println( "Value set to 0.0." ); } } // Accessor method: // returns current value of model public String getModel( ) { return model; } // Accessor method: // returns current value of milesDriven public int getMilesDriven( ) { return milesDriven; } // Accessor method: // returns current value of gallonsOfGas public double getGallonsOfGas( ) { return gallonsOfGas; } }:confused: