title: How to create a .java file using java?
body: <p>I want to create a .java file but I'm doing something wrong as when I try to create it, I simply get a directory named example.java.</p>
  
  <p>What I want to do is actually create a file with the extension <code>.java</code></p>
  
  <p>This is the snippet of my code which isn't working as wished:</p>
  
  <p><code>new File(src, name + ".java").mkdir();</code></p>
  
  <p>How can I implement as described above?</p>