try this

Code:
import java.io.*;
import java.util.Scanner;

class num{
    public static void main(String args[])    { 
        int array[]=new int[10];
        for (int i=0;i<10;i++){//arrays starts from 0
            Scanner input = new Scanner(System.in);
            array[i] = input.nextInt();
    
          }
          System.out.println("descending order...");
          Descending(array);
          for (int i=0;i<array.length;i++)
              System.out.print(" "+array[i]+" ");
          System.out.println("");
          System.out.println("ascending order...");
          Ascending(array);
          for (int i=0;i<array.length;i++)
              System.out.print(" "+array[i]+" ");  
          System.out.println("");            
        }
    
    static void Descending (int array[]){
        int temp;
       for(int j=array.length-1;j>0;j--){
           for(int y=0;y<j;y++){
               if (array[y]<array[y+1]){
                       temp= array[y];
                       array[y]=array[y+1];
                       array[y+1]=temp;
                   }     
               }
        }
    }
        
    
    
    
    
   static  void Ascending (int array[]){
        int temp;
       for(int j=array.length-1;j>0;j--){
           for(int y=0;y<j;y++){
             if (array[y]>array[y+1]){
                 temp= array[y];
                    array[y]=array[y+1];
                 array[y+1]=temp;
             }
          }
       }
    }
}