How would you find out if a machine’s stack grows up or down in memory? (JAVA)
c, java
Solution
If you're not doing any native code, then I can't imagine a situation where it could possibly matter in pure Java code. After all, the Java stack might be allocated in any direction at all instead of being a strictly contiguous block of memory (like the machine stack).
Problem
I have a C program to check whether the machine stack is growing up or down in memory in. It goes like that : ``` #include <stdio .h> void sub(int *a) { int b; if (&b > a) { printf("Stack grows up."); } else { printf("Stack grows down."); } } main () { int a; sub(&a); } ``` Now i want to do the same in Java. :-) Any one knows a solution without writing any native code ??? Thanks