public class JavaApplication87 {
public static void main(String[] args) {
Drive dr = new Drive("Insert type of car");
System.out.println(dr.carType);
}
}
class Drive{
int miles;
int gas;
String carType;
public Drive(String ct){
carType = ct;
miles = 1;
gas = 1;
}
int getGas(){
return gas;
}
}
I'm pretty sure this is what you're looking for. Best of luck.