int A = 300;
int B = 400;
int C = 1000;
int D = 500;
int []abcd = {A,B,C,D};
Arrays.sort(abcd); // the sequence of array elements will be {300, 400, 500,1000}
I think you are misunderstanding something about the way that arrays of primitives work. When you create the array int[] abcd = {A,B,C,D}, it does not contain the variables A, B, C, and D, it should contain copies of their values.
Hence, when you sort them, you do not actually have any impact on A, B, C, or D.
One way to accomplish something close to what you are trying to do would be to use a sorted map, where each value would map into a value holder, you can then iterate over the keys (in a sorted order) and assign a sequential number to each value holder.
If you clarify more about what you're really trying to do, it may be easier to help.