File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes File Creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "File Creation" Watch "File Creation" New topic

File Creation

Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
File junitOutputDir = new File("logs/", "junit.output");

Can anybody explain what this code is doing?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10817

Did you read the File API?

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Zeeshan Sheikh
Ranch Hand

Joined: Nov 20, 2011
Posts: 144


A detail explanation of File class.

The Path class is an upgraded version of the well-known class.

Answer to your Question: You are making a new instance of class file. Once you have the File object then you can work on your file.

MySQL Blog
I agree. Here's the link:
subject: File Creation
It's not a secret anymore!