Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Deleting a file  RSS feed

 
faisal usmani
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,

I was wondering is there any way in java to delete a file which is on a hard disk .



regards
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look in the java.io.File class, I think there is a method that should do it.
 
faisal usmani
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Keith , would be really thankful if you could tell me the name of the method.


regards
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look at the API docs, you will see a couple of methods that deal with delete.
 
Abhinaba Basu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the code

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!