How to convert BigInteger to String in java

前端 未结 9 1687
眼角桃花
眼角桃花 2020-12-24 13:39

I converted a String to BigInteger as follows:

Scanner sc=new Scanner(System.in);
System.out.println(\"enter the message\");
String         


        
9条回答
  •  感动是毒
    2020-12-24 14:06

    You can also use Java's implicit conversion:

    BigInteger m = new BigInteger(bytemsg); 
    String mStr = "" + m;  // mStr now contains string representation of m.
    

提交回复
热议问题