Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FerryBoat {
- private Map<Integer, Reserva> reserva;
- public FerryBoat(){
- reserva = new HashMap<>();
- }
- public void criarReserva(Reserva r) throws ReservaExeption {
- if (!reserva.containsKey(r.getnReserva())) {
- reserva.put(r.getnReserva(), r);
- } else {
- throw new ReservaExpetion("Erro : Reserva Rep!");
- }
- }
- public float getMaiorCarga() {
- float total=0;
- for(Reserva re : reserva.values()){
- total = re.PesoTotReserva();
- }
- return total;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement