I am unable to create temporary file
<p>I am trying to create a temporary files using java.But when i run my codes it shows the following error.</p>

<pre><code>number.java:7: cannot find symbol
symbol  : class Path
location: class number
    Path tempFile = Files.createTempFile(null, ".txt");
    ^
number.java:7: cannot find symbol
symbol  : method createTempFile(&lt;nulltype&gt;,java.lang.String)
location: class Files
    Path tempFile = Files.createTempFile(null, ".txt");
                         ^
2 errors
</code></pre>

<p>and here's the code
and when i import java.io.file;.then it show error package does not exist</p>

<pre><code>import java.io.*;


public class number{
public static void main(String args[])
{try {
    Path tempFile = Files.createTempFile(null, ".txt");
    System.out.format("The temporary file" +
        " has been created: %s%n", tempFile);
} catch (IOException x) {
    System.err.format("IOException: %s%n", x);
}
}}
</code></pre>
