I found this code somewhere, perlin noise generator, I think:
static {
for(int i=0; i<512; i++) perm[i]=p[i & 255];
}
What does the static do there? it was spammed in a lot other places as well... The code was practically built with static{} everywhere. I lost the original code somewhere so thats the only thing I have, but it was like that code above: no variable declarations there, which why I dont get it.
I think this is Java, not C++, which would mean it's a static initialization block.
My guess is that it is in fact java code and java static block. Basically, the block that is executed more or less when the static variable would be initialized. (when the class is loaded, but actually I'm not ready to answer questions tagged java).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With