I am trying to print decimal number from binary number using BigInteger class. I am using BigInteger(String val, int radix) constructor of BigInteger class to convert given binary value to decimal but it is printing the exact binary value which is passed in constructor.Waht is the error? The code is as follows:
System.out.print("Ente the decimal number:");
s=String.valueOf(sc.nextInt());
BigInteger i=new BigInteger(s,10);
System.out.println(i);