Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.File;

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

        // create new File objects
        File f = new File("C:/test.txt");
        File f1 = new File("C:/testA.txt");

        // rename file
        boolean bool = f.renameTo(f1);

        // print
        System.out.print("File renamed? " + bool);

    }
}