This document discusses different number bases including decimal, binary, octal, and hexadecimal. It provides examples of converting between the bases, such as representing 147 in decimal as 10010011 in binary. Techniques are presented for storing numbers in different bases using prefixes like 0b for binary and 0 for octal. Common operations on different bases are also demonstrated, such as binary addition and octal multiplication.
This document discusses different number bases including decimal, binary, octal, and hexadecimal. It provides examples of converting between the bases, such as representing 147 in decimal as 10010011 in binary. Techniques are presented for storing numbers in different bases using prefixes like 0b for binary and 0 for octal. Common operations on different bases are also demonstrated, such as binary addition and octal multiplication.
This document discusses different number bases including decimal, binary, octal, and hexadecimal. It provides examples of converting between the bases, such as representing 147 in decimal as 10010011 in binary. Techniques are presented for storing numbers in different bases using prefixes like 0b for binary and 0 for octal. Common operations on different bases are also demonstrated, such as binary addition and octal multiplication.
the leading 0 indicates octal format Convert an integer variable to a hex String: f3d hex Convert an integer variable to a binary String: 111100111101 bin Convert an integer variable to an octal String: 7475 oct
int
int
Base conversion using parseInt:
String
int
Integer.parseInt(3w4br, 35) A technique for converting 147 from decimal to binary:
10010011 bin = 147 dec
A technique for converting 3741 from decimal to hex: