Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream(new File("C://test.txt"));

        // skip bytes from file input stream
        fis.skip(4);

        // read bytes from this stream
        int i = fis.read();

        // converts integer to character
        char c = (char) i;
        System.out.print("Character read: " + c);
    }
}