Advertisement
TenshiNoKioku

classe

Jan 14th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. import java.io.Serializable;
  2.  
  3. public class Libro implements Serializable {
  4.  
  5.     private String nome, autore;
  6.     private int costo;
  7.    
  8.    
  9.    
  10.    //costruttore
  11. /* 
  12. public Libro (String nome, String autore, int costo)
  13. {
  14.     this.setNome(nome);
  15.     this.setAutore(autore);
  16.     this.setCosto(costo);
  17.    
  18.    
  19. }
  20. */
  21.  
  22.  
  23. public String getNome() {
  24.     return nome;
  25. }
  26.  
  27.  
  28.  
  29. public void setNome(String nome) {
  30.     this.nome = nome;
  31. }
  32.  
  33.  
  34.  
  35. public String getAutore() {
  36.     return autore;
  37. }
  38.  
  39.  
  40.  
  41. public void setAutore(String autore) {
  42.     this.autore =autore;
  43. }
  44.  
  45.  
  46.  
  47. public int getCosto() {
  48.     return costo;
  49. }
  50.  
  51.  
  52.  
  53. public void setCosto(int costo) {
  54.     this.costo = costo;
  55. }
  56.  
  57. public String toString() {
  58.     return this.getNome();
  59.          
  60.   }
  61.    
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement