Skip to content

Instantly share code, notes, and snippets.

@drpventura
Created January 19, 2017 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drpventura/7bfb80184a88a0a3e36c20b17fb8d5ca to your computer and use it in GitHub Desktop.
Save drpventura/7bfb80184a88a0a3e36c20b17fb8d5ca to your computer and use it in GitHub Desktop.
Simple file access using Scanner
package edu.usf;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Benford {
public static void main(String[] args) throws FileNotFoundException {
Scanner s = new Scanner(new File("data/sample1.txt"));
System.out.println(s.nextLine());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment