For this Question: A positive integer num is given to you. Any two digits of num with the same parity can be swapped (i. e. both odd digits or both even digits).
After any number of swaps, output the largest attainable value of num.The first line contains the integer num.

Constraints:
1<= num <= 1e9After any number of digit swaps, output the largest number possible.Sample Input 1:
1234
Sample Output 1:
3412
Explanation 1:
When the digit 3 is swapped with the digit 1, the result is 3214.
The number 3412 is obtained by swapping the digit 2 with the numeral 4.
It's worth noting that there might be alternative swap sequences, but 3412 is the maximum feasible number.
Also, because the parities of the digits 4 and 1 are different, we cannot swap them.

Sample Input 2:
65875
Sample Output 2:
87655
Explanation 2: 
The number 85675 is obtained by replacing the digit 8 with the digit 6.
If you swap the initial digit 5 with the seventh digit, you'll get the number 87655.
There may be alternative swap sequences, but it can be demonstrated that 87655 is the maximum conceivable number., I have written this Solution Code: import java.util.*;
import java.lang.*;

class Main {

    public static void main(String args[])  {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        String numStr = Integer.toString(num);
        PriorityQueue<Integer> oddPQ = new PriorityQueue<>(Collections.reverseOrder());
        PriorityQueue<Integer> evenPQ = new PriorityQueue<>(Collections.reverseOrder());
        for(char digit: numStr.toCharArray()) {
            int value = digit - '0';
            if(value % 2 == 0) {
                evenPQ.offer(value);
            } else {
                oddPQ.offer(value);
            }
        }
        int answer = 0;
        for(char digit: numStr.toCharArray()) {
            answer *= 10;
            if((digit - '0') % 2 == 0) {
                answer += evenPQ.poll();
            } else {
                answer += oddPQ.poll();
            }
        }
        System.out.println(answer);
    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?