Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. package progettolibro;
  2. import java.io.*;
  3. import java.lang.*; // libreria utilizzata per le stringhe
  4. public class libro {
  5. private String autore;
  6. private String titolo;
  7. private int NumPagine;
  8. private boolean prestato;
  9.  
  10. //costruttore
  11. public libro(){
  12. this.autore="";
  13. this.titolo="";
  14. this.NumPagine=0;
  15. this.prestato=false;
  16. }
  17. public void LeggiDati(int i){
  18. InputStreamReader input = new InputStreamReader (System.in);
  19. BufferedReader tastiera = new BufferedReader (input);
  20. String appoggio ="";
  21. System.out.println("Inserisci i dati del libro"+(i+1));
  22. System.out.println("Inserici il titolo");
  23. try {
  24. appoggio = tastiera.readLine();
  25. }
  26. catch (IOException e){System.out.println("Errore di inserimento dati");}
  27. NumPagine = Integer.valueOf(appoggio).intValue();
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement