Program to read a file

import java.util.Scanner;
import java.io.File;

public class FileRead {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(new File(args[0]));
       
        while (scan.hasNext()) {
            System.out.println(scan.nextLine());
        }
    }
}

Comments

Popular posts from this blog

Zeller's Congruence

Property Event-Delegation

Method with variable arguments