Hi i want to convert a long integer to binary but the problem is i want a fixed 16 bit binary result after conversion like if i convert 2 to 16 bit binary it should give me
Binary is a representation and not a format to convert an integer to. For example, if you have an integer:
int i = 2;
The binary representation will be 00000010. Java has only signed integers, so this link will be helpful.