Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;

public class Main {
    public static void main(String[] args) throws Exception {
        RandomAccessFile raf = new RandomAccessFile("test.txt", "rw");
        FileChannel fileChannel = raf.getChannel();

        FileLock lock = fileChannel.lock();

    }
}