I am having trouble with my Police Officer class, it says its incompatible types. What does that mean? Help Please
public class ParkedCar {
private String make;
private String model;
private String color;
private String license;
private static int minutes;
public ParkedCar() {
}
public ParkedCar(String carMake, String carModel, String carColor, String carLicense, int carMinutes) {
make = carMake;
model = carModel;
color = carColor;
license = carLicense;
minutes = carMinutes;
}
public String getMake() {
return make;
}
public String getModel() {
return model;
}
public String getColor() {
return color;
}
public String getLicense() {
return license;
}
public static int getMinutes() {
return minutes;
}
public String toString() {
String string = "Make: " + make
+ "\nModel: " + model
+ "\nColor: " + color
+ "\nLicense Plate: " + license;
return string;
}
}
___________________
public class ParkingMeter
{
private static int minPurchased;
public ParkingMeter() {
}
public ParkingMeter(int carMinPurchased) {
minPurchased = carMinPurchased;
}
public static int getMinPurchased() {
return minPurchased;
}
public String toString() {
String string = "Minutes Purchased: " + minPurchased;
return string;
}
}
____________________
public class ParkingTicket {
private ParkedCar vehicle;
private PoliceOfficer policeofficer;
private double fine;
private int minutes;
private double firstFine = 25;
private double moreFine = 10;
public ParkingTicket(ParkedCar car, PoliceOfficer cop, double guyFine, int mins) {
vehicle = car;
policeofficer = cop;
fine = guyFine;
minutes = mins;
}
public void getTotalFine() {
int time = ParkedCar.getMinutes() - ParkingMeter.getMinPurchased();
if(time <= 60) {
fine = firstFine;
}
else {
fine = firstFine + moreFine * (time / 60);
}
}
public double getFirstFine() {
return firstFine;
}
public double getMoreFine() {
return moreFine;
}
public ParkedCar getVehicle() {
return vehicle;
}
public PoliceOfficer getpoliceofficer() {
return policeofficer;
}
public int getMinutes() {
return minutes;
}
public double getFine() {
return fine;
}
}
_____________
public class PoliceOfficer {
private String name;
private int badge;
private static double ticket;
public PoliceOfficer() {
}
public PoliceOfficer(String poName, int poBadge) {
name = poName;
badge = poBadge;
}
public String getName() {
return name;
}
public int getBadge() {
return badge;
}
static ParkingTicket search(ParkedCar car, ParkingMeter meter) {
int time = ParkedCar.getMinutes() - ParkingMeter.getMinPurchased();
if(ParkedCar.getMinutes() > ParkingMeter.getMinPurchased()) {
if(time <= 60) {
ticket = 25;
}
else {
ticket = 25 + (10 * (time/60));
}
}
return ticket;
}
}
______________
public class Demo
{
public static void main(String[] args) {
ParkedCar car = new ParkedCar();
ParkingMeter meter = new ParkingMeter();
PoliceOfficer john = new PoliceOfficer();
ParkingTicket ticket = PoliceOfficer.search(car, meter);
if(ticket != null) {
System.out.println(ticket);
}
else {
System.out.println("Car is not doing anything wrong!");
}
}
}