Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Sorting

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Location
    Bangladesh
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sorting

    class ArrayShort
    {
    public static void main(String args[])
    {
    int a[] = {7,10,100,2,1,5,11,70,50,99,22,29,10,79,80,11,19,4 2,31,27};
    int temp=0;
    for(int i=0;i<a.length;i++)
    {
    for(int j=0;j<a.length;j++)
    {
    if(a[j]>a[i])
    {
    temp = a[i];
    a[i] = a[j];
    a[j] = temp;
    }
    }
    }
    for(int i=0;i<a.length;i++)
    System.out.println("a["+i+"] = "+a[i]);
    System.out.println("");
    }
    }



    ///My text pad could not compile any program.....What's my computer problem?//////


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,372
    Thanks
    183
    Thanked 836 Times in 779 Posts
    Blog Entries
    5

    Default Re: Sorting

    This thread is marked as solved but no reply or post edit saying as much....is your problem solved?

Similar Threads

  1. Sorting question
    By kadrek in forum What's Wrong With My Code?
    Replies: 7
    Last Post: August 29th, 2013, 08:30 AM
  2. SORTING ALGORITHMS...
    By Medo Almasry in forum Algorithms & Recursion
    Replies: 3
    Last Post: October 14th, 2011, 09:18 PM
  3. Sorting substring?
    By alpvii in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 23rd, 2011, 06:39 AM
  4. [SOLVED] sorting
    By kite98765 in forum Algorithms & Recursion
    Replies: 8
    Last Post: February 4th, 2010, 08:34 AM
  5. Sorting Algorithms
    By Dalisra in forum Java Code Snippets and Tutorials
    Replies: 1
    Last Post: November 10th, 2009, 09:24 PM