Java File(String parent, String child) Constructor

Syntax

File(String parent, String child) constructor from File has the following syntax.

public File(String parent,  String child)

Example

In the following code shows how to use File.File(String parent, String child) constructor.


/*  w  ww.  j a v a2 s.  co m*/
import java.io.File;

public class Main {

  public static void main(String[] args) {
    File aFile = new File("c:/","abc.txt");
    System.out.println(aFile.isAbsolute());//false

  }
}

The code above generates the following result.