Hi....
I'm a new member .
I've a code , but there is a part I didn't undestand it.
Can u help me to undestand it?
I am writing the part I didn't understand it by red color:
import javax.swing.JOptionPane;
public class SortingArray
{
public static void main(String[] argus){
int i,j,temp;
int[] intArray = new int[7];
for(i = 0; i < intArray.length; i++){
intArray[i] = Integer.parseInt(JOptionPane.showInputDialog("Enter the number for location " + i));
}
System.out.println("Array content before sorting ");
for (i = 0 ; i< intArray.length;i++)
System.out.print(intArray[i] + " ");
System.out.println("");
for (i = intArray.length-1; i>=0 ; i--)
for (j = 0 ; j < i ;j++)
if (intArray[j] > intArray[j+1]){
temp = intArray[j];
intArray[j] = intArray[j+1];
intArray[j+1] = temp;}
System.out.println(" Array content after sorting");
for(i=0 ; i < intArray.length;i++)
System.out.print(intArray[i] +"");
}
}
Thank u for helping me