Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to to use Array object sorting method in java

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 458
    Comment on it

     In the below example I have used ArraySorting method to sorting array object. Here I have initialized Object array and then I have used Array sorting method and
    java.util.Arrays.sort(Object[]) method to sort object ArrayList. You can see below program it will clearly describe to use Array object  sorting method in java .

    import java.util.Arrays;
    public class Array9 {
    
       public static void main(String[] args) {
    
       // initializing Object array
       Object ob[] = {24, 110, 04};
    
       // sorting array
       Arrays.sort(ob);
    
       // let us print all the elements available in list
       System.out.println("The sorted Object array is:");
       for (Object number : ob) {
       System.out.println("Number = " + number);
       }
       }
    }
    
    

     

    Output- The sorted Object array is:
    Number = 4
    Number = 24
    Number = 110

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: