This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes File question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "File question" Watch "File question" New topic
Author

File question

Johnson K Jose
Ranch Hand

Joined: Jul 07, 2002
Posts: 36

Why I am getting the error? Is it because f2 is not identified as a file object?
API says
public static File createTempFile(String prefix, String suffix)throws IOException
Creates an empty file in the default temporary-file directory, using the given prefix and suffix to generate its name.
Can any one please guide me where I am going wrong?
Thanks in advance
Johnson
Johnson K Jose
Ranch Hand

Joined: Jul 07, 2002
Posts: 36
Sorry friends, I am able to find out the mistake!!
I have to put System.out.println("The File Path is :" + f2.getPath());
Inside the try block
What a silly am I? Sorry for the trouble.
Regards
Johnson
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: File question
 
Similar Threads
File renameTo()
signed applet + temp file location
File Input/Output
on File methods
File I/O