Roke98

Libros

Sep 17th, 2022
1,177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.99 KB | None | 0 0
  1. package Practico1;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Arrays;
  5.  
  6. public class Libros {
  7.     private String titulo;
  8.     private ArrayList<String> autores;
  9.     private String editorial;
  10.     private int añoDePublicacion;
  11.     private float precio;
  12.     private String genero;
  13.    
  14.     public Libros() {
  15.        
  16.     }
  17.    
  18.     public Libros (String titulo, ArrayList<String> autores, String editorial, int añoDePublicacion, float precio, String genero){
  19.        
  20.         this.titulo = titulo;
  21.         this.autores = autores;
  22.         this.editorial = editorial;
  23.         this.añoDePublicacion = añoDePublicacion;
  24.         this.precio = precio;
  25.     }
  26.  
  27.     @Override
  28.     public String toString(){
  29.         return  ("\nTITULO:............."+getTitulo()
  30.                 +"\nAUTOR:.............."+getAutores()
  31.                 +"\nEDITORIAL:.........."+getEditorial()
  32.                 +"\nAÑO DE PUBLICACION:."+getAñoDePublicacion()
  33.                 +"\nPRECIO:............$"+getPrecio()
  34.                 +"\nGENERO:............."+getGenero());
  35.     }
  36.    
  37.     //Getter-Setter
  38.     public String getTitulo() {
  39.         return titulo;
  40.     }
  41.  
  42.     public void setTitulo(String titulo) {
  43.         this.titulo = titulo;
  44.     }
  45.  
  46.     public ArrayList<String> getAutores() {
  47.         return autores;
  48.     }
  49.  
  50.     public void setAutores(ArrayList<String> autor) {
  51.         this.autores = autor;
  52.     }
  53.  
  54.     public String getEditorial() {
  55.         return editorial;
  56.     }
  57.  
  58.     public void setEditorial(String editorial) {
  59.         this.editorial = editorial;
  60.     }
  61.  
  62.     public int getAñoDePublicacion() {
  63.         return añoDePublicacion;
  64.     }
  65.  
  66.     public void setAñoDePublicacion(int anio) {
  67.         this.añoDePublicacion = anio;
  68.     }
  69.  
  70.     public float getPrecio() {
  71.         return precio;
  72.     }
  73.  
  74.     public void setPrecio(float precio) {
  75.         this.precio = precio;
  76.     }
  77.  
  78.     public String getGenero() {
  79.         return genero;
  80.     }
  81.  
  82.     public void setGenero(String string) {
  83.         this.genero = string;
  84.     }
  85.  
  86.     public static int size() {
  87.         // TODO Auto-generated method stub
  88.         return 0;
  89.     }
  90.  
  91.     public static Object get(int i) {
  92.         // TODO Auto-generated method stub
  93.         return null;
  94.     }
  95.    
  96. }
Advertisement
Add Comment
Please, Sign In to add comment