I have to admit to all my work with Java, I have never encountered the need to combine Java (for example, C-connections, not SQL-code), and I can not find the answer here on SO. Admittedly, most of my work in Java was on higher abstractions than bit-fiddling.
I have an integer for which I set the individual bits, and I want to print an equivalent float with one precision IEEE754.
In C, I would do something like:
union {
int i;
float f;
} x;
x.i = 0x27;
printf ("%f\n", x.f);
How to do a similar thing in Java? Is it even possible to process the same memory as two different data types in Java?
I searched both SO and elsewhere for "java union", but it covered me with SQL materials - I could not find a way to do this.