So I'm fairly new to java and to programming in general, I hope someone could help me with this. Also I'm aware that there are unnecessary syntax in the code but that's because it's not exactly what I have to do for my assignment but I modified it so that it will run on the main instead of inside another class.
I've been stuck on this problem for a while and I can't seem to figure out how to print out the array. I THINK that my formula to get the binary is correct, but whenever I would try to print out the array it would give me : [I@5df86e79
int value = 69;
int length =8;
int remainder1 = 0;
int[] bits = new int[length];
int bitstring=0;
while(value>0 && length<32 && length>0){
for(int i=bits.length;i>0;i--){
remainder1=value%2;
value=value/2;
bits[i-1] = bitstring+remainder1;
}
}
System.out.println(bits);
Arrays.toString(array).Arrays.toString(bits)