MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/*
 * Output:
 *  
 */

import java.io.RandomAccessFile;

public class MainClass {

    public static void main(String args[]) {

        try {

            RandomAccessFile raf = new RandomAccessFile(args[0], "r");

            long position = raf.length();

            while (position > 0) {

                position -= 1;

                raf.seek(position);
                byte b = raf.readByte();

                System.out.print((char) b);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}