Java : Making a method to sort an array -


i'm trying make method sorting arrays have array made, i'm not sure returning , calling it. please?

public void bubblesort(string words [][] ) {          (byte count1 = 0; count1 < words.length - 1; count1++)              (byte count2 = 0; count2 < ((words.length)-count1); count2++) {             system.out.print(words[count1][count2] + " ");              arrays.sort(words);           }         return words [count1][count2];     } 

there no need return array main() functions change in contents of array reflects in array passed during function call in main. in main function following :

  1. intialize 2-d string :

    string[][] rows = new string[10][10]; 
  2. put required array in it.

  3. then call function

    bubblesort(rows); 

the rows array contains sorted string.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -