here is some code from one class...
public boolean ticketStatus(){
if (fine > 0){
status = true;
}
else{
status = false;
}
return status;
}
and this is from another class...
public void getTicket(){
if (parkingticket.ticketStatus()){
toString();
}
else{
System.out.println("you do not have a ticket. ");
}
}
the toString method
public String toString(){
return(parkingticket + "\n" + parkingmeter + "\n" + parkedcar );
}
and this is from the driver class:
police.getTicket();
it always prints out "you do not have a ticket " even if i do have a fine. is there anything fundamentally wrong with any of this code above?