c  « bit « Java Data Type Q&A

1. question about 128 bit number    stackoverflow.com

can i represent 128 bit number in java? or in c++?

2. How the bits are stored in C++, How to represent similar functionality in Java    stackoverflow.com

I have in C++:

typedef struct _msk {
char    abc[4];
//some more variables

_msk mr;

if (some condition >= 70) {
   mr.abc[0] |= 0xC0;   //C0 in binary 11000000

3. How to follow C++ bit storage in Java?    stackoverflow.com

if I have in c++:

char abc[4];

abc[0] = 0xC0; //11000000 in binary

abc[1] = 0x20; //00100000 in binary

abc[2] = 0x44; //01000100 in binary

abc[3] = 0x20; //00100000 in binary
So how this will be stored ...

4. C++ to Java Code Conversion doubts    stackoverflow.com

I am Converting some code from c++ to Java. Having the following doubts-

  1. C++ - static char **gprs; In Java - private static String[] gprs; OR private static Byte[] gprs;
  2. C++ - static ...

5. Is there a more elegant way of doing these bitwise operations?    stackoverflow.com

I built this program that does some bitwise operations on three numbers: 2, 4 and 20:

public static void main(String[] args) {
    int mask = 63;