how to convert "BigInteger" into "Integer"? how to print out a BigInteger binary value?

Discussion in 'Java' started by nick, Oct 26, 2004.

  1. nick

    nick Guest

    1. bitstring=new BigInteger("1010",2);
    System.out.print(bitstring);
    the print out answer will convert to decimal ,how to print out a binary value?


    2.how to convert "BigInteger" into "Integer"?

    thanks!
     
    nick, Oct 26, 2004
    #1
    1. Advertisements

  2. nick

    Eric Sosman Guest

    Look for the toString(int) method in the JavaDoc
    for the BigInteger class.
    Look for the intValue() method in the JavaDoc for
    the BigInteger class.
    You're welcome. Elementary questions are more at
    home in comp.lang.java.help than here (followups set) --
    but even in that group, the fact that you have not
    thought to consult the JavaDoc may earn you a certain
    amount of well-deserved ridicule. RTFM!
     
    Eric Sosman, Oct 26, 2004
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.