Train ticketing system in java