MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/*
 * Output:
 *  
 */

import java.io.File;

public class MainClass {

    public static void main(String args[]) {

        try {

            File oldFile = new File(args[0]);

            File newFile = new File(args[1]);

            boolean result = oldFile.renameTo(newFile);

            System.out.println(result);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}