This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
java:exceptions_try_catch_block [2019/04/20 03:40] gthanos [Παράδειγμα - Ανοίγοντας ένα αρχείο για διάβασμα] |
java:exceptions_try_catch_block [2019/04/20 03:55] gthanos [Άλλο παράδειγμα - Ανοίγοντας ένα αρχείο για διάβασμα] |
||
---|---|---|---|
Line 82: | Line 82: | ||
StringBuffer strDocument = new StringBuffer(); | StringBuffer strDocument = new StringBuffer(); | ||
while ((inputLine = in.readLine()) != null) { | while ((inputLine = in.readLine()) != null) { | ||
- | strDocument.append(inputLine); | + | strDocument.append(inputLine+"\n"); |
//throw new IOException(); | //throw new IOException(); | ||
} | } | ||
Line 169: | Line 169: | ||
while ((inputLine = in.readLine()) != null) { | while ((inputLine = in.readLine()) != null) { | ||
strDocument.append(inputLine); | strDocument.append(inputLine); | ||
- | //throw new IOException(); | ||
} | } | ||
return strDocument.toString(); | return strDocument.toString(); |