I can not get my code to comply it gets mad that I have run declare more than once. Please help me figure out how to get this to work package projectOne; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; import java.util.*; import java.io.*; public class Main { public static void main(String[] pArgs){ Main mainObject = new Main(); mainObject.run(); } private void run() { public FileReader readFile() throws FileNotFoundException { FileReader file = new FileReader(\"p01-in.txt\"); return file; } public ArrayList<Integer> getData(FileReader file) throws FileNotFoundException { Scanner data_read = new Scanner(new BufferedReader(file)); ArrayList<Integer> data = new ArrayList<Integer>(); while (data_read.hasNext()) { int item = data_read.nextInt(); data.add(item); } return data; } public ArrayList<Integer> calcRuns(ArrayList<Integer> data) { ArrayList<Integer> runs = new ArrayList<Integer>(); Iterator<Integer> i_data = data.iterator(); int run = 0; int temp = i_data.next(); while (i_data.hasNext()) { int t1 = i_data.next(); if (temp < t1) run++; else { runs.add(run); run = 0; } temp = t1; } i_data = data.iterator(); temp = i_data.next(); run = 0; while (i_data.hasNext()) { int t1 = i_data.next(); if (temp > t1) run++; else { runs.add(run); run = 0; } temp = t1; } return runs; } public void writeOutput(ArrayList<Integer> runs) throws IOException { PrintWriter out = new PrintWriter(new File(\"p01-runs.txt\")); ArrayList<Integer> run_count = new ArrayList<Integer>(); int i = 0; int r_count = Collections.frequency(run_count, i); while (i < 100) { run_count.add(r_count); i++; r_count = Collections.frequency(runs, i); } Iterator<Integer> i_runs = run_count.iterator(); i = 0; while (i_runs.hasNext()) { int run = i_runs.next(); String line = \"run_\" + i + \" ,\" + run; i++; out.println(line); } } public void run() throws Exception { FileReader fin = this.readFile(); ArrayList<Integer> data = this.getData(fin); ArrayList<Integer> runs = this.calcRuns(data); this.writeOutput(runs); } } Solution In your program you have to change the syntax errors at method declaration.so your not getting output. .