{"id":138,"date":"2013-10-29T10:37:12","date_gmt":"2013-10-29T09:37:12","guid":{"rendered":"http:\/\/www.gpeano.org\/robot\/?p=138"},"modified":"2013-10-29T10:37:12","modified_gmt":"2013-10-29T09:37:12","slug":"filedidati","status":"publish","type":"post","link":"https:\/\/liceocuneo.it\/robot\/filedidati\/","title":{"rendered":"FileDiDati"},"content":{"rendered":"<pre>import java.io.BufferedWriter;\nimport java.io.FileWriter;\nimport java.io.IOException;\n\npublic class Scrittura {\n\n\tpublic static void main(String[] args) {\n\n\t\ttry {\n\t\t\tFileWriter fw = new FileWriter(\"dati.txt\");\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\n\t\t\tfor (int i = 1; i &lt;= 10; i++) {\n\t\t\t\tbw.write(\"3 x \" + i + \" = \" + 3 * i);\n\t\t\t\tbw.newLine();\n\t\t\t}\n\n\t\t\tbw.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Errore nel salvataggio dei dati\");\n\t\t}\n\t}\n\n}<\/pre>\n<pre>import java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.IOException;\n\npublic class Lettura {\n\n\tpublic static void main(String[] args) {\n\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(\"dati.txt\");\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\tfor (int i = 1; i &lt;= 10; i++) {\n\t\t\t\tSystem.out.println(br.readLine());\n\t\t\t}\n\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Errore nel salvataggio dei dati\");\n\t\t}\n\t}\n\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; public class Scrittura { public static void main(String[] args) { try { FileWriter fw = new FileWriter(&#8220;dati.txt&#8221;); BufferedWriter bw = new BufferedWriter(fw); for (int i = 1; i &lt;= 10; i++) { bw.write(&#8220;3 x &#8221; + i + &#8221; = &#8221; + 3 * i); bw.newLine(); } bw.close(); } [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-senza-categoria"],"_links":{"self":[{"href":"https:\/\/liceocuneo.it\/robot\/wp-json\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liceocuneo.it\/robot\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liceocuneo.it\/robot\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liceocuneo.it\/robot\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/liceocuneo.it\/robot\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":0,"href":"https:\/\/liceocuneo.it\/robot\/wp-json\/wp\/v2\/posts\/138\/revisions"}],"wp:attachment":[{"href":"https:\/\/liceocuneo.it\/robot\/wp-json\/wp\/v2\/media?parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liceocuneo.it\/robot\/wp-json\/wp\/v2\/categories?post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liceocuneo.it\/robot\/wp-json\/wp\/v2\/tags?post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}