For this Question: Given a non-negative Integer x, check if this number is constant, constant number is a number whose digits are all same.The first line contains 1 integer x.

<b>Constraints</b>
0 &le; x &le; 10<sup>5</sup>Print true if the number is constant, otherwise, false.Sample Input 1 :
20

Sample Output 1 :
false

Sample Input 2 :
2222

Sample Output 2 :
true, I have written this Solution Code: import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        assert n>=0&&n<=100000 : "Input Not Valid";
        int curr=n%10;
        boolean ans=true;
        while(n>0){
            int c=n%10;
            n/=10;
            if(c!=curr){
                ans=false;
                break;
            }
            curr = c;
        }
        System.out.print(ans);
        
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?