Hello all! My first post here
I've started teaching myself java and at the moment am making a really simple number sorter to sort an array in ascending order. As far as I'm aware I have the number sorting bit down and amusingly the thing I'm stuck on is getting the new sorted array to print. I'm trying to do it via loops rather than the prebuilt java classes as I really want to get a proper grasp of loops before i move on. Anyways I'm getting 15 compile errors at the mo (won't post them here as they are really long) and they are all for my print loop. If anyone could have a look at my code and tell me whats up it would be much appreciated!
Thanks
Native
import java.io.*; class SortAsc { public static void main ( String agrs[] ) { int A[]={8,9,3,10}; int i,k; for(i=0;i<4;i++) { for(k=0;k<4;k++) { if (A[k]<A[i]) { int temp; temp = A[k]; A[k] = A[i]; A[i] = temp; } } } } int l; for(l=0;l<4;l++) { System.out.print(A[l]); } }