Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package uscrimedata;
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.IOException;
- import java.util.Scanner;
- import java.io.FileInputStream;
- public class USCrimeData {
- public static void main(String[] args) {
- int[] crime = new int[20];
- int i = 0;
- BufferedReader inputStream = null;
- FileInputStream in = null;
- Scanner scannerIn = null;
- try {
- inputStream = new BufferedReader(new FileReader("Crime.csv"));
- scannerIn = new Scanner(inputStream);
- for (i = 0; i < 20; i++) {
- crime[i] = scannerIn.nextInt();
- }
- }
- catch (IOException io) {
- io.getMessage();
- }
- finally {
- try {
- if (inputStream != null) {
- inputStream.close();
- }
- }
- catch (IOException io) {
- io.getMessage();
- }
- }
- }
Add Comment
Please, Sign In to add comment