03.02.2015 Views

Input e Output in Java

Input e Output in Java

Input e Output in Java

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Inserimento dati: quando i dati<br />

sono tanti<br />

●<br />

●<br />

●<br />

●<br />

È molto noioso e ripetitivo <strong>in</strong>serire dati <strong>in</strong> maniera<br />

<strong>in</strong>terattiva se i dati sono molti<br />

Sarebbe utile poter <strong>in</strong>serire tutti i dati che servono <strong>in</strong><br />

un file di testo e poi fare <strong>in</strong> modo che il programma li<br />

prenda da lì<br />

Un modo molto semplice per fare questo è quello di<br />

utilizzare la lettura di dati da console e poi, <strong>in</strong> fase di<br />

esecuzione del programma, re<strong>in</strong>dirizzare l’<strong>in</strong>put da<br />

un file<br />

Nel ma<strong>in</strong> bisogna prendere l'<strong>in</strong>put da System.<strong>in</strong><br />

Laboratorio di Programmazione - Luca Tesei<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!