MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/*
 * Output:
test.txt is not hidden
 */

import java.io.File;

public class MainClass {
    public static void main(String[] args) {

        // Create an object that is a directory
        File myFile = new File("test.txt");
        System.out.println(myFile + (myFile.isHidden() ? " is" : " is not") + " hidden");
    }
}