I'm referring to the actually java compiler implementation here:

I guess the stack is implemented as a **C** struct, but what I really mean is:

How does java calculate with this structure? For example, if one local variable is of type string or pointer, and the other is a double, or an int, and java needs to operate on these variables, say add both, does it first convert both to the same type and then add, and return the value?

Would it be more or less like this:

```
struct var {
    dataType type;
    union{
        char c;
        int i;
        double d;
        void *p;
    } value;
}

```

where dataType is some enumeration of data types.

For example: Let's say variable A is a double, and variable B is an int, and C is again a double.

How is the bytecode generated for C = A + B? and how does the virtual machine operate with these different data types?