Easy Sorting in Java
Are you confused of using techniques such as Bubble sort or Selection sort in order to sort the elements in an array? I don't say that these sort techniques are so complex, rather I would say that there are some alternatives for sorting the array using the inbuilt methods in java. There is a class called Arrays in the util package of java: java.util.Arrays; In this class there is an method called Arrays.sort() ; This is used to sort the elements of an array in an ascending order. Don't forget to note that the class name Array s is in plural form. Pass the name of the array in the parameter of the method and you will find that the elements in the array will be sorted and stored in the same array. You can also pass the from_Index and to_Index along with the array name in the parameter. The parameter can be of any array type such as int[], char[], byte[], etc. Take a look at this program: - /**Importing the required class*/ import java.util.Arrays; /**Cl