Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Java: Общие вопросы > Работа с системами исчеслений


Автор: sith 7.6.2007, 09:11
... как получить допустим из инта двоичное число... и дальше с ним работать... тоже касаеться и к 8-ому и к 16-му и как обратно в десятичное вернуть...

Автор: fixxer 7.6.2007, 10:33
Javadoc рулит, в прочем как всегда  smile 

public final class Integer
extends Number
implements Comparable<Integer>

static String    toBinaryString(int i)
          Returns a string representation of the integer argument as an unsigned integer in base 2.
static String    toHexString(int i)
          Returns a string representation of the integer argument as an unsigned integer in base 16.
static String    toOctalString(int i)
          Returns a string representation of the integer argument as an unsigned integer in base 8.

static int    parseInt(String s, int radix)
          Parses the string argument as a signed integer in the radix specified by the second argument.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)