Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  2. #22
    Metastar's Avatar
    Metastar is offline Member
    Join Date
    Jul 2010
    Posts
    62
    Rep Power
    0

    Default

    I actually figured out I didn't have the < 0. :) But I try and call the bubbleSort() in Main but it still gives an error :/

    Java Code:
    public static void main(String[] args) throws java.io.IOException
        {
            FileInputStream fis1 = new FileInputStream("AsiaCountries.Fall2010.txt");
            BufferedReader br1 = new BufferedReader(new InputStreamReader(fis1));
    
            String inline;
            int totalReg1Counter = 0, totalReg2Counter = 0, totalReg3Counter = 0;
            int totalReg4Counter = 0, index = 0;
            Country[] myCountries;
            myCountries = new Country[43];
    
    
            while ((inline = br1.readLine()) != null)
            {
                myCountries[index] = new Country(inline);
                index++;
    
            for(int count=0; count < index; count++)
            {
                System.out.println(myCountries[count]);
            }//end for
            
            myCountries.bubbleSort();
        }//end main()
    }//end Main
    Am I calling it in the wrong place?

  3. #23
    Metastar's Avatar
    Metastar is offline Member
    Join Date
    Jul 2010
    Posts
    62
    Rep Power
    0

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Bubble sort
    By pineapple in forum New To Java
    Replies: 3
    Last Post: 04-25-2009, 01:45 AM
  2. Trouble w/ Bubble Sort
    By bri1547 in forum New To Java
    Replies: 4
    Last Post: 08-01-2008, 05:41 PM
  3. How to sort a list using Bubble sort algorithm
    By Java Tip in forum Algorithms
    Replies: 3
    Last Post: 04-29-2008, 09:04 PM
  4. Bubble Sort in Java
    By Java Tip in forum Algorithms
    Replies: 0
    Last Post: 04-15-2008, 08:42 PM
  5. need help with bubble sort
    By lowpro in forum New To Java
    Replies: 3
    Last Post: 12-17-2007, 06:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •