Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File question  RSS feed

 
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
Boost this thread!