03.02.2015 Views

Input e Output in Java

Input e Output in Java

Input e Output in Java

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Scomposizione di str<strong>in</strong>ghe<br />

● E se volessimo, per comodità, <strong>in</strong>serire i valori nel file di<br />

testo anche su una stessa riga<br />

● Ad esempio:<br />

13 343.54 100.09 25<br />

1.8 12 3<br />

33<br />

● Il metodo readL<strong>in</strong>e() della classe<br />

BufferedReader legge una <strong>in</strong>tera riga per volta<br />

● Se proviamo a fare il pars<strong>in</strong>g di una riga con diversi<br />

numeri separati da spazi bianchi il metodo<br />

parseDouble solleva un’eccezione<br />

Laboratorio di Programmazione - Luca Tesei<br />

9

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

Saved successfully!

Ooh no, something went wrong!