How to apply sorting array in Java?
<pre><code>import java.io.*;

public class conversion{

  public static void main(String args[]) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    int a,i=0,k=0,y=0,l=0, o=0;

    System.out.println("\n\n   D  E  C  I  M  A  L   C  O  N  V  E  R  S  I  O  N\n\n\n");

    System.out.print("Enter Decimal value: ");

    String decimal = br.readLine();
    int j = Integer.parseInt(decimal);

    l=j;
    o=l;
    k=0;

    System.out.print("\n\nB I N A R Y: ");


    while(j&gt;0){
      k=j%2;
      j=j/2;
      i--;
      System.out.print(k);
    }

    System.out.print("\n\nO C T A L: ");

    while(o&gt;0)
    {
      k=o%8;
      o=o/8;
      i--;
      System.out.print(k);
    }

    System.out.print("\n\nH E X A D E C I M A L: ");

    while(l&gt;0)
    {
      k=l%16;
      l=l/16;
      i--;

      if(k&lt;=9)
      {
        System.out.print(k);
      }
      if(k==10)
      {
        System.out.print("A");
      }
      if(k==11)
      {
        System.out.print("B");
      }
      if(k==12)
      {
        System.out.print("C");
      }
      if(k==13)
      {
        System.out.print("D");
      }
      if(k==14)
      {
        System.out.print("E");
      }
      if(k==15)
      {
        System.out.print("F");
      }
    }

  }
}
</code></pre>
