Skip to content

Instantly share code, notes, and snippets.

@mattmccarthy11
Created November 4, 2015 03:59
Show Gist options
  • Save mattmccarthy11/1ac0db84f0e5f6f4a751 to your computer and use it in GitHub Desktop.
Save mattmccarthy11/1ac0db84f0e5f6f4a751 to your computer and use it in GitHub Desktop.

Revisions

  1. mattmccarthy11 revised this gist Nov 4, 2015. No changes.
  2. mattmccarthy11 created this gist Nov 4, 2015.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    String[] mystr = {"Jack","Fortran","Amon","Cpp","Phaser"};

    for(int i=0;i<mystr.length-1;i++){
    for(int j=i+1 ;j<mystr.length;j++){

    if( mystr[i].compareTo(mystr[j]) > 0 ){
    String tmp = mystr[i];
    mystr[i]= mystr[j];
    mystr[j]=tmp;
    }
    }
    }