After creating file using java, there were no values in it
<p>I  have created file using java, with following code </p>

<pre><code>String Filecontent= "hei";
</code></pre>

<p>creating file</p>

<pre><code>PrintWriter writer=new PrintWriter("D://balanworkspace//Coretest//Corejavatest//src//intvquestest//mydet3_8.txt","UTF-8"); 
</code></pre>

<p>printing the string</p>

<pre><code>System.out.println(Filecontent); 
</code></pre>

<p>writing to file</p>

<pre><code>writer.println(Filecontent); 
</code></pre>

<p>when I opened the file, there is no values.  Why is it so?</p>