Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert an int to a BigInteger

 
Steve Watson
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I convert an int to a BigInteger?
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String s = Integer.toString( 3 ); // convert the int to String
BigInteger big = new BigInteger( s );

Joyce
[ August 05, 2004: Message edited by: Joyce Lee ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic