You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
904 B

2 years ago
  1. import java.util.ArrayList;
  2. public class Hotel {
  3. public static ArrayList<Hotel> lista = new ArrayList<Hotel>();
  4. private String nombre;
  5. private String ciudad;
  6. private int estrellas;
  7. public Hotel(String nombre, String ciudad, int estrellas) {
  8. this.nombre = nombre;
  9. this.ciudad = ciudad;
  10. this.estrellas = estrellas;
  11. }
  12. @Override
  13. public String toString() {
  14. return nombre + ciudad + estrellas;
  15. }
  16. public String datos() {
  17. return "'" + this.nombre + "','" +
  18. this.ciudad + "'," +
  19. this.estrellas + "\n";
  20. }
  21. public String getNombre() {
  22. return nombre;
  23. }
  24. public void setNombre(String nombre) {
  25. this.nombre = nombre;
  26. }
  27. public String getCiudad() {
  28. return ciudad;
  29. }
  30. public void setCiudad(String ciudad) {
  31. this.ciudad = ciudad;
  32. }
  33. public int getEstrellas() {
  34. return estrellas;
  35. }
  36. public void setEstrellas(int estrellas) {
  37. this.estrellas = estrellas;
  38. }
  39. }