Computer Science Canada Integer Sorter |
Author: | SapphireBlue [ Mon Apr 18, 2011 8:27 am ] |
Post subject: | Integer Sorter |
Hello. In my program, Integer Sorter, I'm having many errors: File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 23] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:23: cannot find symbol symbol : variable arrayList location: class IntegerSorter File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 23] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:23: cannot find symbol symbol : class Array location: class IntegerSorter File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 27] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:27: cannot find symbol symbol : variable array location: class IntegerSorter File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 28] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:28: cannot find symbol symbol : variable List location: class IntegerSorter File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 31] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:31: cannot find symbol symbol : variable Arrays location: class IntegerSorter File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 31] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:31: cannot find symbol symbol : variable List location: class IntegerSorter File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 35] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:35: cannot find symbol symbol : variable array location: class IntegerSorter File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 36] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:36: cannot find symbol symbol : variable List location: class IntegerSorter File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 42] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:42: x is already defined in sort_method1(int[]) File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 42] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:42: cannot find symbol symbol : variable array location: class IntegerSorter File: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java [line: 43] Error: H:\Computers\Java\dr.java\Work\Integer Sorter\IntegerSorter.java:43: cannot find symbol symbol : variable array location: class IntegerSorter Can someone give me tips on how to correct the following errors? Here is my code so far: //Margaret //Computer Science import java.awt.*; public class IntegerSorter implements Sorter{ public void setList(int[] list){ } public void sort(int type){ } public String toString(){ } public static void main(String[] args) { //First, we will create an array. arrayList [8] = new Array [] {4, 2, 14, 9, 5, 7, 1, 10}; //Second, in this part, we will make this program print out the orginal. So, for example: 4,2,14,9,5,7,1,10. The program will output 4,2,14,9,5,7,1,10 in ascending order. System.out.println ("Original question: \n "); for (int order = 0; order < array.List; order++) System.out.println (" " + List[order]); // Thirdly, we want to sort this out. Arrays.sort (List); //print out in ascending order System.out.println ("Sorted Answer: \n "); for(int order = 0; order < array.length ; order++) System.out.print(" " + List[order]); //long System.currentTime Millis() } public void sort_method1 (int [] list){ int x; for (int x = 0; x < array.length; x++){ for (int y = 0; y < array.length; y++){ } } } } |
Author: | Insectoid [ Mon Apr 18, 2011 10:02 am ] |
Post subject: | RE:Integer Sorter |
Try reading the errors, figuring out what they mean, going to the lines they specify, and fixing them. Hint: 'array' does not exist. arrayList does though. |
Author: | Tony [ Mon Apr 18, 2011 12:10 pm ] | ||
Post subject: | RE:Integer Sorter | ||
well, kind of. You'd expect arrayList to be declared, but honestly I still can't figure out what
is supposed to be. The assortment of: arrayList, array.List, List, and array; don't exactly help clarity either. |
Author: | md [ Mon Apr 18, 2011 12:23 pm ] | ||
Post subject: | RE:Integer Sorter | ||
I would assume he means something like
|