Expected DOT, found 'array name'

I think I’ve found a bug with the IDE. If it’s not a bug, please tell what I’m doing wrong. Whenever I have something like this

byte[] TestByteArray = new byte[] {
  0b0
};

it gives me this error:
expecting DOT, found ‘TestByteArray’

I also don’t know if the code formatting worked, so I’ll just have to hope it did

Edit: Apparently it did work
Also, this is the only code I have in this project, and it only throws an error if I use 0b. If I use numbers, or even 0x then it will work, but not 0b. (there’s no other code because I ran into this problem on another project and I wanted to isolate it to make sure nothing else was causing it)

Edit 2: I just realized is it because you can’t do 0b0? I could have sworn that was a thing

1 Like

It does not seem to like this:

Works if you just use a 0.

Tried this:

byte b = 0b00001111;

byte[] TestByteArray = new byte[] {b};

void setup() 
	{
  size(640, 360);
  println(TestByteArray[0]);
	}

void draw() 
	{
  background(0);
	}
1 Like

so you can use 0b0 just not in an array?

also, it seems like you can’t do
println (0b00001111);
but you can do
println (0xF);

1 Like
byte[] TestByteArray = new byte[] {
  (byte) 0xb0
};
1 Like

Processing 3 uses Java 8.
I have been working around things like this as they arise.
I tried using binary literals for some masking and had to go back to hexadecimal.

Processing 4 uses Java 11 and does not have these errors for the few examples I tried:

https://docs.oracle.com/javase/8/docs/technotes/guides/language/binary-literals.html

:)