• Post Reply Bookmark Topic Watch Topic
  • New Topic

create file

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the name of the file that is created by this code

 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
None. No file is created. Check out the File api to figure out which one's do.
 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand it needs createNewFile() method

But still doesn't know what will be the name?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15711
73
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you call createNewFile() on the File object, it will create a file named bar in the /tmp directory.

Please read the documentation of class java.io.File.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!