Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File question

 
Johnson K Jose
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic