Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

lol help

Name: Anonymous 2008-03-15 20:39

Noob programmer here, I can't figure out why I keep getting the error "Cannot find symbol class ArrayList".


import java.awt.*;
import javax.swing.*;
import java.util.Scanner;

public class MyArray{  
  


     public static void main()     {
        int i=0, thesame, size;         
      
        ArrayList<String> list = new ArrayList<String>();
         Scanner input = new Scanner(System.in);
         bString = "done";
         for(i=0;i!=2.5;i++){
              System.out.print("Enter a name");
              nextWord = input.nextString;
              list.add(i, nextWord);
              boolean theSame = bString.equals("Done");
              if(theSame = 0)
                  i = 1.5;
         }   
          int size = list.size();
          for(i=0;i<=0;i++){
              String temp = copy.get(i);
              System.out.print(temp);
            }  
               
               
    }
    public ArrayList sort(ArrayList list){
      
        int top, i, maxIdx, copy1;
       
       
        ArrayList<Sring> copy = new ArrayList<String>(list.size());
       
    for (int i = 0;i < list.size;i++)
        copy.add((string)list.get(i));
    for (int top=copy.size-1;top > 0;top--) {
        ArrayList maximum = ((string)copy.get(0));
        int maxIdx = 0;

        for (int search=1;search <= top;search++){
            String name = ((string)copy.get(search)) ;
            String topName = ((string)copy.get(top)) ;
          
            if (name.compareTo(top) = 1) {
                 Sting maximum = ((string)copy.get(search));
                 maxIdx = search;
            }
        }
        if (maxIdx != top) {
        ArrayList swap = ((string)copy.get(top));
        copy1= ((string)copy.get(maxIdx));
        copy.set(top,copy1);
        copy.set(maxIdx,swap);
       }
     }
    return copy;


}
}

Name: Anonymous 2008-03-16 21:09

Op here, I loved my last comp sci class as it was based in c++. I was great at it and I ended up with an A in the class, but so far java just seems like a pain in the ass language that has no benefit unless i want to make little faggy applets, of course since im new at this im probably wrong but it just seems that way right now which is really turning me off from computer science

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List