for (int x = 0; x < count - j; x++)
{
String name1 = arr[x].getDogName();
String name2 = arr[x+1].getDogName();
if ( name1.compareTo(name2) > 0)
{
tmp = arr[x];
arr[x] = arr[x + 1];
arr[x + 1] = tmp;
swapped = true;
}//end if
}//end for
and this is the second error location.
//array
Dogs[] dArray = new Dogs[100];
dArray[0] = d1;
dArray[1] = d2;
dArray[2] = d3;
dArray[3] = d4;
dArray[4] = d5;
dArray[5] = d6;
dArray[6] = d7;
dArray[7] = d8;
bubbleSort(dArray, count);
//print above
for(int x = 0; x < count; x++)
{
System.out.println( dArray[x].toString() );
}
I hope this is enough information and in the right format. This is my first post. I apologize if I did something wrong.

New Topic/Question
Reply




MultiQuote







|